문제

원격 메소드 호출을하는 동안 OutofMemoryException을 얻습니다.

"ormotentity.setLocalStore (데이터 세트);"

전달 된 값은 데이터 세트입니다.

참고 데이터 세트의 크기는 38MB입니다

Envoirment 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);

        }
도움이 되었습니까?

해결책

나는 당신이 대답을 알고 있다고 생각합니다. 38MB는 원격 통화에 비해 너무 큰 일입니다. 더 진단하는 데 도움이되는 것은 문제를 현지에서 실행하는 두 가지 기능으로 문제를 단순화하여 완전한 예를 보여주는 것입니다.

이렇게하면 원격 인터페이스 / 네트워크 구성에서 데이터 세트의 크기 또는 크기 제약 조건인지 감지하는 데 도움이됩니다.

또한 작업 샘플을 사용하면 다른 사람이 문제를 복제하고 유형 정보를 볼 수 있습니다 (예 : 객체 유형이 예외를 던지고 MSDN에서 어떤 제약 조건을 찾을 수 없는지 알 수 없습니다). 나는 이것으로 누군가가 결정적인 답을 제공 할 수있을 것이라고 확신합니다.

코드를 샘플로 줄이는 행위는 그 자체로 원인을 찾을 수있을 것입니다.

라이언

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top