Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
USER objects hits 10,000 and crashes opening / closing WinForm with WinGrid
posted

Using Infragistics Winform 11.1

Our application makes heavy use of the Infragistics UserControls especially the UltraWinGrid. Our application is a MdiContainer and there are a bunch of different workflows available that will create a new forms and set the MdiParent to the main application. The particular workflow that I was testing would involving me right clicking on a row in a UltraWinGrid, select a menu item and then opening up a new form, I would then close the form and repeat 64 times. After the 64th time I repeated this operation the USER objects (from task manager)  for our application was 10,000 and the next time I tried opening the form the dreaded Red X replaced the UltraWinGrid in the new form.

While investigating the heap using sos.dll I noticed a bunch of objects that were increasing in count over the lifetime of the process. Some of the Infragistics objects that had the largest growth (but not limited to) are Infragistics.Win.UIElementCollection (811 -> 4122), Infragistics.Win.AppStyling.StylePropertyCache (712 -> 1947), Infragistics.Win.Appearance (532 -> 1469), Infragistics.Win.AppearanceHolder (524 -> 1522), Infragistics.Shared.UltraLicense (127 – 936). The counts are after the 1st time I executed the workflow to after the last time I executed the workflow.

The end result and issues seemed to mimic what is seen in this forum post http://es.infragistics.com/community/forums/p/8451/33498.aspx. After further investigation it appears the event has been changed to a System.WeakReference, but the number of System.WeakReferences grew from 2,877 to just under 26,000 when our app crashed.

I have gone though our code base and to make sure we are properly cleaning up, the biggest offender on the heap is System.EventHandler which ends with a count of 227,217 objects on the heap. Another EventHander of note is Infragistics.Shared.SUbObjectPropChangeEventHandler which got up to 10,752 objects on the heap.

Side note, the System.Windows.NativeMethods+WndProc object on the heap seemed to match up pretty closely with the USER objects value from Task Manager.

Hopefully this is enough information to at least start some dialog.

Thanks,

Matt