Designer does not release memory used by components when loading a new project. Designer continues to consume memory until it crashes. On WinXP, it will typically crash once memory usage exceeds 1GB RAM. Simply opening new projects without makes changes and without closing the XDS window will cause the application to become slow, unstable, and vulnerable to crashes.
Steps to reproduce the problem:
At the moment of initializing XDS, memory usage is about 60MB
Open a large(-ish) project - my 4.x project is over 640KB.
After opening my 640KB file, XDS memory usage is about 275MB.
Click preview (on any viewable class). XDS memory increases to 300MB.
Close preview and memory returns to about 275MB.
After previewing the same class a few times and closing the preview window each time, the memory usage increases about 10MB.
Open a new project (from File menu). This time I choose a small 65KB 4.x project.
Memory usage increases to 300MB. There is no apparent release of memory consumed by the previous project.
From File menu, Select open and reopen the same project (discard changes if needed). XDS memory usage increases again to 330MB.
From File menu, Select open recent and I selected the first opened large 4.x project (filesize= 640KB ). XDS memory usage balloons to 470MB!
The result that was expected:
When opening a new project without closing Designer (aka XDS), all objects should be properly destroyed/deleted from memory.
The result that occurs instead:
Memory isn't properly managed. XDS continues to consume memory until it finally crashes without saves and recourse.
Screenshot(s) or Video:
Debugging already done:
Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...
When in doubt, check the d4mn source code!
And here are my terms...
I don't care if you use my source code. (Known as "Code.")
I don't care if I get any monetary compensation.
I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
You are welcome to change and improve the Code to best meet your needs.
I don't care if you use the Code in a commercial or open-source project.
You are not required to contact me prior to using the Code.