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

RadPaneGroup memory leak

5 Answers 260 Views
Docking
This is a migrated thread and some comments may be shown as answers.
alvin
Top achievements
Rank 1
alvin asked on 19 Mar 2012, 06:54 PM
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.

5 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 20 Mar 2012, 09:27 AM
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 >>
0
alvin
Top achievements
Rank 1
answered on 20 Mar 2012, 01:02 PM
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.
0
Georgi
Telerik team
answered on 21 Mar 2012, 02:35 PM
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 >>
0
alvin
Top achievements
Rank 1
answered on 21 Mar 2012, 03:46 PM
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
0
Georgi
Telerik team
answered on 23 Mar 2012, 02:04 PM
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 >>
Tags
Docking
Asked by
alvin
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
alvin
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or