Please let me know if we can force garbage collector to disallocate memory of objects.
Joined: Nov 08, 2006
No, we cant force garbage collector to do deallocate memory,only we can request garbage collector to do so(using System.gc() ), but there is no guarantee tht garbage collector deallocates memory when request is passed to it.
Joined: Apr 06, 2006
I don't think you can force garbage collection. you can do Runtime.getRuntime.gc() or System.gc(). this will instruct the virtual machine to garbage collect but it is not necessary that JVM will do it immediately....