"Casper B" <ca****@jbr.dk> wrote in message
news:42*********************@dread12.news.tele.dk. ..
But if you want to be sure, then set t = null; after the call to goo
And (assuming everything is syncronous) if you REALLY want to be in
control, call the garbage collector explicitly:
System.gc();
/Casper
.... Except that the GC will never let you be in control. The call to
System.gc() is only a _suggestion_ to JVM to run the garbage collector. The
JVM may or may not do it on your request. Also, setting t to null is
superfluous. Once t goes out of scope in the given example, all references
to it are gone, and it becomes eligible for the collection - whether it was
nulled out or not.