RadForm memory leak problem

4 posts, 0 answers
  1. Roman Kharko
    Roman Kharko avatar
    3 posts
    Member since:
    Jun 2012

    Posted 25 Mar 2010 Link to this post

    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);


  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 29 Mar 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Llorens Mathieu
    Llorens Mathieu avatar
    19 posts
    Member since:
    Jan 2009

    Posted 07 Apr 2010 Link to this post

    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
  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 12 Apr 2010 Link to this post

    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.
Back to Top