I just found today a problem with memory allocation with my screens. When I open a screen the memory allocation for the .net Add-on naturally increases. The problem is when I exit the sceen...it does not go back down. I have made sure that the Form_Count has been subtracted and the Dispose() Sub has been called.
That Sub includes setting my Form, Item, Package, Button, Textbox and datasoruce all equal to Nothing. I also call Systems.GC.Collect(). Still, the memory is not reduced at all. So, when opening the screen and closing then opening again, the memory grows to a point where the application becomes sluggish.
Is there anything else I need to be setting to Nothing? Is there any other System function that I need to be calling?
I've never heard of the UI API having a memory leak. I've certainly come across leaks in the DI API, most noticeable if your add-on performs a loop while adding transactions or metadata objects.
You could try using the following commands to force garbage collection and see if this improves the situation (C#):
where MyCOMObject is the UI API or DI API object you've instantiated.