1

Good Afternoon, At my company, we have an application (portal) which opens up my application form in a new dialog. I can open up items upto 15 times before I get the following exception on 16th item (every time)

form.ShowDialog();

Here are the exception details.

System.Runtime.InteropServices.COMException was caught Message=Exception from HRESULT: 0x88980406 Source=PresentationCore ErrorCode=-2003303418 StackTrace: at System.Windows.Media.Composition.DUCE.Channel.SyncFlush() at System.Windows.Media.MediaContext.CompleteRender() at System.Windows.Interop.HwndTarget.OnResize() at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at System.Windows.Window.ShowDialog() at MyProject.App.Main() in c:\Projects\MyProject\App.xaml.cs:line xxx InnerException:

Other notes: If I add the following line after showdialog()

Dispatcher.CurrentDispatcher.InvokeShutdown();

Then after I close lets say 2 items, I can open 2 more, but it can never exceed more then 15 dialogs at any given point.

Here are details from task mngr when I have upto 15 items open. Memory: Around 280k Threads: 54 Handles 2,248, User Objects: 700ish GDI objects: 372.

After googling around, some similar problems were about having transparency or outdated drivers, I have also set transparency as false and updated all drivers. Some also suggested to update to latest .net framework (4.5) but I cant change that at this point from 3.5.

In my forms, I do have an imagectrl as well as a webbrowser, but I dispose them on close.

Any help would be appreciated.

sylar
  • 366
  • 2
  • 9
  • 1
    Have you tried running the portal in debug? (With the hope that this gives you better error messages) – Sayse Aug 27 '14 at 15:01
  • Duplicate? http://stackoverflow.com/questions/15480028/0x88980406-syncflush-is-there-a-workaround – user469104 Aug 27 '14 at 15:02
  • Sayse, unfortunately I cant debug the portal (dont have code or pdb). I dont think i am pressing memory or hardware limit, I have 8gb ram and have around 50% free when i have 15 items often. – sylar Aug 27 '14 at 15:12
  • @sylar - Your programs memory allowance is different to the amount of ram you have. Without being able to debug the portal its going to be pretty hard to fix this, possibly not even your job to fix it? – Sayse Aug 27 '14 at 15:15
  • @Sayse, are there any common config parameters where you can set memory limit? I can maybe check that out. Other then that I have notified portal folks and was told that something is up with my project and not portal since they cant reproduce it. – sylar Aug 27 '14 at 15:18
  • 700 USER Objects is quite excessive for WPF app. Use a memory profiler to find your leak. – Hans Passant Aug 27 '14 at 15:36
  • I think this points to things not getting garbage collected. One would every time you close the dialog, all the items (controls, objects and resources) being used within that dialog would be disposed off. That should be your stating point. Note if you have managed DLL you should be able to translate that to code using tools like dotpeek etc. – TYY Aug 27 '14 at 19:41

0 Answers0