RichTextBox in RadWindow Does Not Release Memory

4 posts, 0 answers
  1. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 26 Jun 2013 Link to this post

    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.
  2. Boby
    Boby avatar
    719 posts

    Posted 28 Jun 2013 Link to this post

    Hello John,
    We can continue our conversation in the support ticket you opened.

    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 >>
  3. Emmanuel
    Emmanuel  avatar
    1 posts
    Member since:
    May 2015

    Posted 26 Jul 2017 in reply to Boby Link to this post

    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.
  4. Boby
    Boby avatar
    719 posts

    Posted 27 Jul 2017 Link to this post

    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:
    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.

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