This is a migrated thread and some comments may be shown as answers.

RadForm memory leak problem

3 Answers 297 Views
Form
This is a migrated thread and some comments may be shown as answers.
Roman Kharko
Top achievements
Rank 1
Roman Kharko asked on 25 Mar 2010, 02:48 PM

Hi,

My problem is with RadForm. When I create a descendant from RadForm and put on it many telerik components, then I see application memory is increasing every time I open that form. I have prepared a small example: there are two forms: first form is just standard .NET form with button to open RadForm and then ask GC about Total used memory. I have used version 2009.2.729 and the problem was with one form, which after 100 times of opening and closing results in about 2 gigabytes of allocated memory. I have checked the last version of Telerik WinForms 2009.3.9.1203, but it still allocates more memory every next time.

The explicit call to garbage collector does not help.

And why I can't attach zip file ?

You can download the zip archive (17 kb) from here http://rapidshare.com/files/367983868/TelerikCheck.zip.html

The single method I have write is following :

private void button1_Click(object sender, EventArgs e) {

  FormTelerik form = new FormTelerik();

  DialogResult res  =form.ShowDialog();

  form.Dispose();

  form = null;

  long bytes  = GC.GetTotalMemory(true);

  textBox1.Text = string.Format("{0:F3} Megabytes", 1.0*bytes/1024/1024);


3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 29 Mar 2010, 01:56 PM
Hello Hermann,

Thanks for contacting us and for your project.
 
It seems that there are two instances of the RadGridView control, as well as one instance of the RadMultiColumnComboBox control which are created in the InitializeComponent method of the inherited form, but are not added in a Controls collection. Thus, when you dispose the Form, these instances remain in the memory and are recreated each time you reopen the form. This causes a memory leak. After removing these unnecessary initializations from the InitializeComponent I do not seem to detect other memory footprint issues.

I have attached the modified version of you project for your reference.

Note: you cannot attach files via the public forum. This is done for security purposes to avoid distributing paid assemblies, 3rd party assemblies, and code (that may be considered someone's intellectual property and may be under NDA). Only images can be attached in the Forums. In order to attach a file, you should open a new support ticket.
 

Regards,
Deyan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Llorens Mathieu
Top achievements
Rank 1
answered on 07 Apr 2010, 10:10 AM
Hi,
How did you detect that those objects was not added to the form controls collection? Because I have the same problem of memory leak and I'd like to fix it.

Thank you
0
Deyan
Telerik team
answered on 12 Apr 2010, 12:50 PM
Hi Llorens Mathieu,

Just take a look at the InitializeComponent method of your form. If there are control instances created which are not put in the Controls collection of the form, these might lead to memory leaks.

I hope this helps.

Sincerely yours,
Deyan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Form
Asked by
Roman Kharko
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Llorens Mathieu
Top achievements
Rank 1
Share this question
or