Tuesday, 15 January 2019

c# - Multiple opening and closing of modules using Prism crashes application

We have a PRISM Shell application with 10 to 15 modules.



When we open and close a module around 30 to 50 times, it crashes with the following exception:




Message: HandlingInstanceID: c7d05b8e-9c0b-49d6-8dff-328ed4a4f78c An

exception of type 'System.OutOfMemoryException' occurred and was
caught.
--------------------------------------------------------------------------- 09/11/2014 17:03:46 Type : System.OutOfMemoryException, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Nicht genügend Speicher verfügbar, um das Programm weiter
auszuführen. Source : PresentationCore Help link : Data :
System.Collections.ListDictionaryInternal TargetSite : Void
SyncFlush() HResult : -2147024882 Stack Trace : bei
System.Windows.Media.Composition.DUCE.Channel.SyncFlush() bei
System.Windows.Media.MediaContext.CompleteRender() bei

System.Windows.Interop.HwndTarget.OnResize() bei
System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg,
IntPtr wparam, IntPtr lparam) bei
System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd,
Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) bei
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam,
IntPtr lParam, Boolean& handled) bei
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) bei
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs) bei

MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate
catchHandler) bei
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority
priority, TimeSpan timeout, Delegate method, Object args, Int32
numArgs) bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,
Int32 msg, IntPtr wParam, IntPtr lParam) bei
MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr
hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) bei
MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr hwnd, Int32 msg, IntPtr

wParam, IntPtr lParam) bei
MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr
hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) bei
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr
wParam, IntPtr lParam) bei
MS.Win32.UnsafeNativeMethods.ShowWindow(HandleRef hWnd, Int32
nCmdShow) bei System.Windows.Window.ShowHelper(Object booleanBox)
bei System.Windows.Window.Show() bei
System.Windows.Window.ShowDialog() bei
Rodenstock.Consulting.ViewModel.ShellWindowViewModel.DisplaySplashScreen(Object
moduleName) bei

System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) bei
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx) bei
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) bei
System.Threading.ThreadHelper.ThreadStart(Object obj)






  1. There is enough memory in the system.

  2. There is enough RAM in the system.

  3. The issue can be reproduced in 32 and 64 bit machines

  4. The issue can be reproduced in Windows XP, Vista, 7 and 8

  5. The end module releases known resources being used




Is there a MEF or PRISM resource that needs to be freed when a module is closed?



UPDATE:
There is a module catalog with all the modules. The bootstrapper loads the module catalog.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...