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

RichTextBox in RadWindow Does Not Release Memory

3 Answers 137 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 26 Jun 2013, 09:29 PM
If I place a RadRichTextBox in a RadWindow, then right-click to display the context menu, memory is not released when the RadWindow is dismissed. How can I get the RadRichTextBox to release the memory?

I have a sample project that I can send you.
The ANTS memory profiler output is attached.

3 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 28 Jun 2013, 06:26 AM
Hello John,
We can continue our conversation in the support ticket you opened.

Regards,
Boby
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Emmanuel
Top achievements
Rank 1
answered on 26 Jul 2017, 07:42 PM
Would you be able to share what was discovered with this post? I'm facing a similar problem with a RadRichTextBox in using a WPF Window.
0
Boby
Telerik team
answered on 27 Jul 2017, 07:22 AM
Hi Emmanuel,

The leak turned out to be related to the RadRichTextBox's ContextMenu, you can read more about it in the public item:
RichTextBox: Memory leak related to ContextMenu

ContextMenu is loaded with MEF, which internally caches the instance, and it holds a reference to the RadRichTextBox. 

One simple workaround is to avoid the caching using the workarounds listed in the item:
- manually set different instances of ContextMenu to all your RadRichTextBox-es:
this.radRichTextBox.ContextMenu = new Telerik.Windows.Controls.RichTextBoxUI.ContextMenu();

Create custom context menu that will be non-sharable. MEF will automatically load different instances of it for all RadRichTextBoxes on demand:
PartCreationPolicy(CreationPolicy.NonShared)]
[CustomContextMenu]
public class NonSharedContextMenu : ContextMenu
{
}

If this is not your case, I would suggest opening a separate support ticket and send us sample application which reproduces the problem, along with specific steps to reproduce. Memory leaks sometimes reveals in specific situations, and this will help us pinpoint the issue faster.

Regards,
Boby
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
RichTextBox
Asked by
John
Top achievements
Rank 1
Answers by
Boby
Telerik team
Emmanuel
Top achievements
Rank 1
Share this question
or