That is correct. System.gc() will attempt to wake up the garbage collection thread, but doesn't guarantee that it will run at that instant.
However, you're missing the real problem: if you are getting to the point that you may need to force a garbage collection you should either (a) manage the number of objects that you're creating, or (b) limit the size of your objects. Doing either may help with your problem.
jR
| Taylor Gautier <[EMAIL PROTECTED]>
Sent by: A mailing list about Java Server Pages specification and reference <[EMAIL PROTECTED]> 11/04/99 02:26 PM
|
To: [EMAIL PROTECTED] cc: Subject: Re: Garbage collection |
That doesn't FORCE garbage collection. Just suggests that if the GC would
like to run, it can.
-tg
----- Original Message -----
From: Pedro Teixeira <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 04, 1999 10:51 AM
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
