2009-11-02 2 views
0

원격 메서드 호출 중에 OutOfMemoryException이 발생합니다.원격 메서드 호출 중에 OutOfMemoryException이 발생했습니다.

"RemoteEntity.SetLocalStore (DATASET);"

전달 된 값은 데이터 집합입니다.

데이터 세트의

참고 크기

Envoirment 38메가바이트는 C# VS2008

감사

코드 : 나는 당신이 답을 알고 있다고 생각

private void backgroundSync_DoWork(object sender, DoWorkEventArgs e) 
     {    
      backgroundSync.ReportProgress(10, "Fetching data for sync ..."); 
      EngagementSet _remoteSet = HKMPClient.Instance.RemoteEntity.GetLocalStore(); 



      //Update to release memory. 
      HKMPClient.Instance.RemoteEntity.SetLocalStore(null); 
      //dispose RemoteEntity 
      HKMPClient.Instance.DisconnectAndDispose(); 

      HKMP.EngagementWorks.Windows.BLL.Engagements.Engagement.MergeEntitiesInLimitedConnecitivity(_remoteSet,EngagementID);    
      backgroundSync.ReportProgress(10, "Synchronizing Engagement ..."); 
      DialogSync _dlgSync = new DialogSync(this.EngagementID, _remoteSet); 
      _dlgSync.ServiceRequestStarted += new DialogSync.OnServiceRequestStarted(_dlgSync_ServiceRequestStarted); 
      _dlgSync.ServiceRequestCompleted += new DialogSync.OnServiceRequestCompleted(_dlgSync_ServiceRequestCompleted); 
      if (_dlgSync.IsShown()) 
      { 
       _dlgSync.StartPosition = FormStartPosition.CenterParent; 
       _dlgSync.WindowState = FormWindowState.Normal; 
       _dlgSync.ShowDialog(); 
      } 
      //Disposed to release object. 
      _dlgSync.Dispose(); 
      _dlgSync = null; 


      // connect again     
      HKMPClient.Instance.Connect(e.Argument.ToString()); 

      _remoteSet.RemotingFormat = SerializationFormat.Binary; 

      HKMPClient.Instance.RemoteEntity.SetLocalStore(_remoteSet); 

     } 
+2

내가 여기있는 일부 코드에서'NullReferenceException'을 얻고 있습니다. 도와 주실 수 있습니까? – jason

+0

흥미롭게도 클라이언트 스레드를 어떻게 실행하고 있습니까? reply.code 블록이 첨부되었습니다. – leppie

답변

1

, 38메가바이트이 ​​이상 할 너무 큰 원격 호출. 문제를 더 쉽게 진단하는 데 도움이되는 것은 로컬에서 실행되는 두 가지 기능만으로 문제를 단순화하여 완전한 예제를 보여주는 것입니다.

이것은 원격 인터페이스/네트워크 구성에서 데이터 집합의 크기인지 또는 크기 제약 조건인지를 찾는 데 도움이됩니다.

또한 작동하는 샘플을 사용하면 다른 사람이 문제를 복제하고 형식 정보를 볼 수 있습니다. 예를 들어 어떤 개체 유형이 예외를 throw하는지 확인할 수없고 MSDN에서 제약 조건을 조회 할 수 없습니다. 나는 이것으로 누군가 확실한 답을 줄 수있을 것이라고 확신한다.

코드로 샘플을 줄이면 그 원인을 찾을 수 있습니다.

Ryan

+0

감사합니다. – Buzz

관련 문제