RadRichTextBox potential memory leak

4 posts, 0 answers
  1. Sebastien
    Sebastien avatar
    5 posts
    Member since:
    Apr 2016

    Posted 06 Apr Link to this post

    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

  2. Boby
    Admin
    Boby avatar
    595 posts

    Posted 07 Apr Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sebastien
    Sebastien avatar
    5 posts
    Member since:
    Apr 2016

    Posted 07 Apr Link to this post

    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

  5. Boby
    Admin
    Boby avatar
    595 posts

    Posted 08 Apr Link to this post

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