Howdy,

>2. With very few exceptions, calling System.gc() is a bad idea.  The
JVM
>knows what it's doing better than you do.

I completely agree.

>4. From what I can tell, the main reason to have a finalize() method is
>if your object has some kind of JNI resources that it needs to clean up
>outside of the JVM.
<snip>
>So... bottom line: Unless you are doing something like using JNI, don't
>use finalizers.

I completely disagree.  Finalize() is a general method with possibly
very broad uses.  It's impossible to say don't use it in general.
Rather, it's a case by case comparison.  Holding references and handles
to various things for the lifetime of an object is a completely valid
design decision for some implementations.

I think the intent and spirit of the finalize() method are well
documented in its javadoc.  A lot of thought went into making it
available (and protected, rather than final / private or public for that
matter) and it has its uses.

Yoav Shapira
Millennium ChemInformatics



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to