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

Spellchecker Not Releasing Memory

3 Answers 199 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Carolyn Hamilton
Top achievements
Rank 1
Carolyn Hamilton asked on 06 Sep 2012, 02:01 PM
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.

3 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 11 Sep 2012, 10:23 AM
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.

0
vineesh
Top achievements
Rank 1
answered on 04 Oct 2012, 06:14 AM
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,
Vineesh
0
Alex
Telerik team
answered on 09 Oct 2012, 10:46 AM
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,
Alex
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Carolyn Hamilton
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
vineesh
Top achievements
Rank 1
Alex
Telerik team
Share this question
or