Current Forum: Homework 5 - Part 3 |
Date: Tue Nov 20 2001 2:21 am |
Author: Cipriani, Jason A. <jac4@andrew.cmu.edu> |
Subject: garbage collection |
|
|
let's say i have an object called HugeObject that takes up a lot of memory. when i _know_ that i am done with it, and that my program does not reference it any more, can i gain more control over freeing it's associated memory by doing:
HugeObject huge = new HugeObject();
// do things with huge ...
// ... later in program
huge = null;
System.gc();
does the garbage collector _always_ run as soon as possible? or do i need to give it a swift kick in the ass by calling System.gc() to do a forced recycling of no-longer-needed memory blocks?
thanks,
jason
|
|