Greg Munt wrote:
> System.gc is not guaranteed to do ANYTHING.
Yes it is. It is guaranteed that the VM will make its best efforts to
reduce the amount of currently allocated memory that has no references
to it. If it has no free references to collect, then it will not appear
to do anything, but it has at least attempted to free any memory, there
was just none to free. I have not yet come across one JVM implementation
that does not do its best to do GC in response to this call. The problem
is that users only call it once expecting it to solve al lthe world's
problems. The best usage is to run it in a loop until it frees no more
memory. This is due to the first pass exposing some more references to
classes that could be reclaimed in an immediate second run, which in
turn exposes more etc.
--
Justin Couch http://www.vlc.com.au/~justin/
Freelance Java Consultant http://www.yumetech.com/
Author, Java 3D FAQ Maintainer http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
- Greg Bear, Slant
-------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".