RadPaneGroup memory leak

6 posts, 0 answers
  1. alvin
    alvin avatar
    7 posts
    Member since:
    May 2011

    Posted 19 Mar 2012 Link to this post

    Hi, 

    It seems there is a potential memory leak issue with RadPaneGroup. When you add one or more RadDocumentPanes to a RadPaneGroup. And then remove them from the RadPaneGroup (such as user closes the pane). At this point the RadPaneGroup still hold reference to the last opened pane.

    See attached the instance retention graph from ANTS.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 20 Mar 2012 Link to this post

    Hello,

    Me managed to fix this problem and the fix will be included in the upcoming 2012 Q1 SP1 version of RadControls for WPF. The fix should be already included in the latest internal build.

    Hope this helps.

    Regards,
    Miroslav Nedyalkov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. alvin
    alvin avatar
    7 posts
    Member since:
    May 2011

    Posted 20 Mar 2012 Link to this post

    Hi, I've just downloaded RadControls_for_WPF_2012_1_0319_DEV_hotfix and the problem still exists. The instance retention graph from ANTS shows the same result.
  5. Georgi
    Admin
    Georgi avatar
    347 posts

    Posted 21 Mar 2012 Link to this post

    Hello Alvin,

    There is a difference between closing pane and remove it. When pane is closed by the user (via close button) it goes hidden. To remove it you need to use RemoveFromParent() method. Can you confirm that you are using RemoveFromParent() method ? I am sending you a simple project where you can see when the pane is collected from the GarbageCollector.

    Kind regards,
    Georgi
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. alvin
    alvin avatar
    7 posts
    Member since:
    May 2011

    Posted 21 Mar 2012 Link to this post

    Hi, I've done some test using your sample project.

    It appears that when a RadPane is added to the RadPaneGroup in XAML and then removed using RemoveFromParent, it will be GCed

    HOWEVER, if the RadPane is added to the RadPaneGroup using AddItem(pane, dockposition), or Items.Add(pane). it WON'T be GCed after calling RemoveFromParent.

    here is what I've done:

    -Remove the RadPane in the group in the xaml file.
    -Add a new button, in the button click event do this:
    var newPane = new RadDocumentPane();
    newPane.Header = "new pane";
    this.group.AddItem(newPane, DockPosition.Center);
    -then start application, click button to add a new pane, then click Remove pane, then check GC, the pane will still be alive.

    Alvin
  7. Georgi
    Admin
    Georgi avatar
    347 posts

    Posted 23 Mar 2012 Link to this post

    Hi Alvin,

    I can confirm that when you add a pane from the code-behind it does stay alive after it is removed from its parent.The good thing is that it can not leak more than one pane in a group. We will investigate it further. Here you can find the PITS item fort the problem.
    Please, excuse us fro the inconvenience. Your Telerik points have been updated.

    Regards,
    Georgi
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top
UI for WPF is Visual Studio 2017 Ready