[cp-patches] [PATCH] Fix PR classpath/24086, PR classpath/24091, PR classpath/24104 et al. ...

Jeroen Frijters jeroen@sumatra.nl
Thu Oct 13 07:48:00 GMT 2005


David Daney wrote:
> A finalizer is simple and gets the job done.

Finalizers are anything but simple. They really should only be used to
free native resources (as a last resort), not for any type of Java clean
up. Blocking and locking should be avoided in a finalizer. Typically
there is only one finalizer thread and you don't want to hog that by
blocking on I/O.

I wrote about how finalize should be used on my blog:
http://weblog.ikvm.net/permalink.aspx?guid=3E0ABC11-F486-4366-9127-CF38B
B6C3EF1

Regards,
Jeroen



More information about the Java-patches mailing list