This does not force garbage collection. It only suggests it. A key point to
remember for the Java certification exam is that there is no way to force
garbage collection. Garbage collection runs as a low priority thread and its
implementation is not strictly detailed in the Java specifications. So how
it works is entirely up to the implementation.


-----Original Message-----
From: Pedro Teixeira [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 04, 1999 12:52 PM
To: [EMAIL PROTECTED]
Subject: Re: Garbage collection


Tao Kang wrote:

> No.  You cannot force garbage collection.

No? What about java.lang.System.gc() ?

--

#################
Pedro Teixeira
USD
Link<-

Tao Kang wrote:

No.  You cannot force garbage collection.  However, you can make an
object to become 'subject to'
garbage collection by making it 'unreachable.'  (assigning the reference
varaible to null, for example)

Because the garbage collector runs asynchronously to your program as a
separate thread, you cannot
predict when it will execute, which unreachable objects it will reclaim,
and when it will reclaim those
objects.

Tae

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to