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

RadRichTextBox potential memory leak

3 Answers 81 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Sebastien
Top achievements
Rank 1
Sebastien asked on 06 Apr 2016, 10:30 AM

Hi,

We're using version 2015.2.728.45 of Telerik UI for WPF and we have discovered a potential memory leak using JustTrace memory profiler (see attached document).

Could you please tell me if there is a known issue that could explain this behaviour of the Telerik.Windows.Documents.DocumentPosition retaining RadRichTextBox controls?

Thanks for your help,

S├ębastien

3 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 07 Apr 2016, 06:31 AM
Hi Sebastien,

Thanks for the investigation. It's hard to tell whether this is memory leak just from looking at the attached screenshot - for example we cannot be sure whether it's expected for this DocumentPosition to be a GC root.

As memory leaks are sometimes very hard to reveal, could you please send us sample application reproducing the problem, as well as specific list of steps to follow?

Regards,
Boby
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Sebastien
Top achievements
Rank 1
answered on 07 Apr 2016, 08:01 AM

Hi Boby,

Actually I'm not able to get this path to GC systematically with JustTrace by reproducing the same use case on my application.

I just wanted to know if you had an explanation about this behaviour, but maybe it is related to JustTrace itself.

Best regards,

S├ębastien

0
Boby
Telerik team
answered on 08 Apr 2016, 06:14 AM
Hello Sebastien,

By default, DocumentPosition is associated to RadDocument, so the first and second relations are normal. When a RadDocument is set to RadRichTextBox.Document property, RadRichTextBox subscribes to its LayoutModeChanged event, so this explains the third relation. (When RadDocument is removed from RadRichTextBox.Document, the event handler is unsubscribed.) 

Whether it's normal for this particular DocumentPosition to be GC root - I cannot tell for sure by just looking at the screenshot - maybe the screenshot was taken during a method execution and it's kept by a local variable in a method somewhere.

Regards,
Boby
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
RichTextBox
Asked by
Sebastien
Top achievements
Rank 1
Answers by
Boby
Telerik team
Sebastien
Top achievements
Rank 1
Share this question
or