Hi,
The test code I wrote was very simple
On btnTest_Click event
frmMyTestForm frmMTF = new frmMyTestForm();
frmMTF.ShowDialog();
frmMTF.Dispose();
frmMTF = null;
On the frmMyTestForm I have a Close button which calls this.Close()
frmMyTestForm has about 25 UI objects (buttons, listbox, etc) without any code attached for testing.
In my commercial application I have datagrids on the form and some UI objects. I am making sure all the data is cleared, the objects disposed and connections clcosed. But just the instantiation of the from object uses up lot of memory which is not getting freed. I tried to use Memory profiler and ensure the count of my form is 0 after closing by removing any static or circular references in the form etc. but still unable to clear the memory utilized.