Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The GC can deal correctly with circular references and if these references were the only things keeping the form alive then they would be collected.<br> I have had lots of trouble with .net not reclaiming memory from forms. In 1.1 there were some bugs aroung menuitem's (I think) which meant that they didn't get disposed and could leak memory. In this case, adding an explicit call to dispose and clearing the member variable in the form's Dispose method sorted the problem. We found that this also helped reclaim memory for some of the other control types.<br> I also spent a long time with CLR profiler looking at why forms were not being collected. As far as I could tell, references were being kept by the framework. One per form type. So if you create 100 instances of Form1, then close them all, only 99 would be reclaimed properly. I didn't find any way to cure this.<br> Our application has since moved to .net 2 and this seems to be much better. Our application memory still increases when we open the first form and doesn't go back down when it is closed but I believe this is becuase of JIT'ed code and extra control libraries that are loaded.<br> I have also found that although the GC can deal with circular references, it seems to have problems (sometimes) with circular event handler references. IE object1 references object2 and object1 has a method that handles and event from object2. I found circumstances where this didn't release the objects when I expected but I was never able to re-produce it in a test case.<br></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload