Re: Controlled memory usage with collections
Posted By:
Anonymous
Posted On:
Friday, July 15, 2005 05:18 AM
Hi Gaurav...,
I guess both java and .net would keep the memory space in both the cases that u've mentioned here, untill the GC is called to perform the clean up function.I'm not sure if java Gc also has something similar to the .net's freachable Q..if u know more on this as well as the memory mgt and mem architecture of java please help me out by providing the details or a link where i can get those details.
TIA
Jits
Re: Controlled memory usage with collections
Posted By:
Stephen_Ostermiller
Posted On:
Sunday, May 15, 2005 09:51 PM
Both do the same thing. When the list goes out of scope (at the end of the function because it is declared as a local variable) it and everything in it becomes available for reclaimation by the garbage collector. If you clear the list, then the objects itself is released for garbage collection, but it still takes up space until the garbage collector runs.