Sage OutOfMemoryException while running a .NET Application via AppLibrary

pneusoft

Neues Mitglied
Hi,

We are building our own Suite of Addons for Sage 9.0 using WPF and Devexpress Libraries. The idea is to open up our custom WPF Applications via Sage using Context Menus. Within our WPF Application, we use Devexpress components , AppDomain Calls (Since Sage is using Devexpress v19.x and we are on v20.x / and to avoid the clash of theme DLLs), Remoting Setups. Each of these applications are a bit heavy on the memory which is close to 200 Mb per instance. When I try to open these applicationcs via Sage's AppLibrary Dlls, the following exception gets thrown.

This exception was originally thrown at this call stack:
System.Windows.Media.Composition.DUCE.Channel.SyncFlush ()
System.Windows.Interop.HwndTarget.UpdateWindowSettings (bool, System.Windows.Media.Composition.DUCE.ChannelSet?)
System.Windows.Interop.HwndTarget.UpdateWindowPos (System.IntPtr)
System.Windows.Interop.HwndTarget.HandleMessage (MS.Internal.Interop.WindowMessage, System.IntPtr, System.IntPtr)
System.Windows.Interop.HwndSource.HwndTargetFilterMessage (System.IntPtr, int, System.IntPtr, System.IntPtr, ref bool)
MS.Win32.HwndWrapper.WndProc (System.IntPtr, int, System.IntPtr, System.IntPtr, ref bool)
MS.Win32.HwndSubclass.DispatcherCallbackOperation (object)
System.Windows.Threading.ExceptionWrapper.InternalRealCall (System.Delegate, object, int)
System.Windows.Threading.ExceptionWrapper.TryCatchWhen (object, System.Delegate, object, int, System.Delegate)
System.Windows.Threading.Dispatcher.LegacyInvokeImpl (System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, object, int)
...
[Call Stack Truncated]

This happens as soon as I open any heavy application (~200mb RAM usage) via Sage. When I open a lighter application via Sage (~100Mb), the exceptions get's thrown in the 3rd or 4th instance of the application.

I have tried Performance / Memory Profiling and found no memory leaks. Tried to manually dispose the memory for objects using Garbage Collector methods. No difference.

Has anyone else faced such issues? Are ApplibraryCalls meants only for smalls DLLs? Or do developers build dlls to open up other WPF applications as well. Any support or guidance on this is appreciated. Thanks.
 
Hi pneusoft,

Unfortunately I can’t find the article anymore, but I’m sure there were threading issues/limits with Microsoft Access. Also the memory size is limited since all threads you start will be in the scope of MS Access.

We also had a WPF application with DX on top of Sage 100 and ran into multiple issues, specially when opening multiple windows. I guess if you try to open as less windows as possible and properly release them when closing (don’t „hide“ windows, close them) the issues you’ll experience will be less often.

Let me know if this information helped you.

Regards
Marcel
 
Zurück
Oben