Spellchecker Not Releasing Memory

4 posts, 0 answers
  1. Martin Gunn
    Martin Gunn avatar
    6 posts
    Member since:
    Feb 2008

    Posted 06 Sep 2012 Link to this post

    Hi there,

    We have an application that uses the RadRichTextBox multiple times in the same dialog, one for each row of data. Each RadRichTextBox makes use of spellchecking. What we've found is that with spellchecking enabled, the memory is not released when the dialog is closed, while it is mostly reclaimed when spellchecking is disabled.

    I might be wrong, but what I've figured from using ANTS Memory Profiler is that it seems to be attributed to the DataChanged event on the SpellChecker; the event doesn't seem to be unsetting when the host object should be disposed. This appears to be causing all related controls to remain in memory.

    As this control is heavily used in our app, the problems quickly add up, and we've seen OutOfMemoryExceptions occur. The attached file shows the ANTS results. Notice the memory usage between the blue and red markers at the top - the rise in memory usage is attributed to repeatedly opening and closing the same item.

    Any assistance with this would be greatly appreciated.
  2. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 11 Sep 2012 Link to this post

    Hi Kevin,

    Thank you for reporting this issue. We have it logged and will try to fix it soon.

    Unfortunately, the fix will probably not make it into the service pack, expected in less than a week. Please excuse us for the inconvenience.

    Kind regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. vineesh
    vineesh avatar
    1 posts
    Member since:
    Oct 2012

    Posted 04 Oct 2012 Link to this post

    Hi Iva,

    Is this issue exists in Telerik version 2012.1.0326.40. Any confirmation on this would be very much appreciated. 
    Also is there any alternative way to solve this issue?

    Best Regards,
  4. Alex
    Alex avatar
    130 posts

    Posted 09 Oct 2012 Link to this post

    Hello Vineesh,
    Since the last release we fixed a couple of issues related to memory leaks. 
    We tested your scenario with RadRichtextBox in a window with spell checking enabled with the latest internal build and didn't found any memory leaks. I've attached the sample project with which we tested. 

    However you scenario is probably more complicated than this. One thing that we noticed form the screenshot from the profiler you've sent is the RichTextBoxContextBehavior class which holds the reference to the DocumentSpellChecker instance that the leaked RadRichTextBox control is using. Is this a static instance? If this is the case you, can detach this behavior when the RadRichTextBox control is unloaded or simply setting its SpellChecker property to null. This will force the rich text box to detach form the DataChanged event which is most probably the reason for the memory leak.

    Please don't hesitate to contact us again if this doesn't work
    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top