We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridControl Memory Leak problems

Thread ID:

Created:

Updated:

Platform:

Replies:

30798 Jun 23,2005 09:48 PM Jun 24,2005 04:05 AM Windows Forms 1
loading
Tags: GridControl
paul
Asked On June 23, 2005 09:48 PM

I have been using Syncfusion Essential Grid (v 1.5.2 I believe). Running my application through a memory profiler I have encountered a few memory leaks. Two of these I have tracked down to minor problems in the Syncfusion source code. There are three events still attached to disposed instances of GridControl. The first two are is in Syncfusion.Windows.Forms.Grid.GridControlBase.UnwireModel(). This method appears to be used to detach event handlers prior to Disposal. One of the event handlers "Model.InvalidateRequestRange" is added instead of removed. (There are 2 handlers attached, instead of zero.) I think this is a simple case of a "+=" instead of an intended "-=" in the source code. This added event appears to prevent the Garbage collector from collecting the grid. Interestingly enough, this only causes problems if the application explictly calls Dispose() on the GridControl for the following reasons: First, note that the .NET garbage collector is really cr*ppy and does not always collect objects that have events pointing to them, even if there are no root paths to those objects. This means that such items need to have these event handlers explicitly removed so that they become elligible for garbage collection. Second, note that if the .NET garbage collector queues an object for collection, it calls IDisposable.Dispose() on that object if necessary and then collects that object. Because of this, if the garbage collector collects the GridControl, the extra event (added during disposal) does not prevent collection as the object is already queued for collection. However, if you explictly call Dispose() on the Syncfusion GridControl, the GridControl is never collected because the event that is added during disposal prevents garbage collection. Lastly, I found that in Syncfusion/Shared/Scrolling/ScrollControl, an event handler is attached to "imm.DragScroll" This event handler appears to never be detached during disposal and thus may also contribute to memory leaks.

Administrator [Syncfusion]
Replied On June 24, 2005 04:05 AM

Thank you for the details. Yes, 1.5.x had some memory leaks. Both problems you mentioned have been corrected in our later releases. They are not in 3.2.1.0.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;