Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
USER object leak with UltraTextEditor
posted

I have a problem with my application which uses Infragistics quite heavily. We are using .NET 3.5 and the last Infragistics release that supports that: 12.1

When I run the application I open a display a form and close the form again. The USER object count in Task Manager increases. I have used a memory profiler and the only thing that shows as being left in memory since before opening the form and then closing it are 4 objects System.Windows.Forms.Command - which are undocumented. However the USER count has increased by a few. Repeatedly opening / closing the form increases the count.

On this form there a number of different control dynamically added. As they are added to a chain from the form's Control collection they are disposed and the memory profiling proves this.

Two of the controls are user controls with UltraTextEditor within them.

Here's what I have discovered - these UltraTextEditor controls have AlwaysInEditMode set to True. If I change this setting to False instead the USER object count does not increase. 

However when I try to reproduce this in a simpler project I am unable to do so and an UltraTextEditor with this setting either True and False I do not see USER count increasing.

I don't really understand how this can be and there are no tracing tools that seem to allow you to examine USER objects.

Help!

  • 12480
    Offline posted

    Hi Gwyn,

    Since it isn't possible to reproduce in a sample application, the next thing to try is to cut things out of your full application until the issue is isolated. Make a copy of your project from which you will remove code. Start by removing modules that you don't think are affecting the memory leak, then remove sections of code from the leaking module that don't seem connected to the leak. Test the memory after removing each piece, until you have a much smaller sample that reproduces it.

    You should be able to get your code to something small enough that you can send to us. Let me know if you want to send anything privately and I'll open a support case.

    Please let me know if you have any questions.

  • 470
    Verified Answer
    posted

    Found the problem. The UltraTextEditors were added to a panel and the panel was being removed deep in a user control. When the form was closed it seems the panel was able to be garbage collected (somehow, as it didn't appear in a memory snapshot) but was not Disposed and so the unmanaged resources I presume are associated with the non-edit text box of the UltraTextEditor were not being freed. All a bit unclear but I've added a Dispose call in the User Control Dispose method for the panel if it has been removed and all is well.

    It's been a week of agony!