The only effective act you can take in a finalizer is to log a warning
that the code is buggy in that it forgot to dispose/close/cleanup
something. Unfortunately, doing this means you get the performance
penalty. You'd almost wish you can shove the 'assert' keyword onto a
finalizer to mean: Just act as if there is no finalize if assertions
aren't enabled :P



On Jul 22, 2:05 pm, Jess Holle <je...@ptc.com> wrote:
> kirk wrote:
> >> If only finalize() would be reliable.
>
> > finalize is reliable, you just have to understand how it's implemented.
>
> In some situations/VMs it can also be easy to outpace the finalizer
> thread(s) such that these don't keep up.
>
> --
> Jess Holle
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to