In article <alpine.DEB.1.10.0907012314060.10594@urchin.earth.li>,
Tom Anderson <twic@urchin.earth.li> wrote:
On Tue, 30 Jun 2009, Kevin McMurtrie wrote:
In article <ocaqh6-dm8.ln1@wellington.fredriksson.dy.fi>,
"Donkey Hottie" <donkey@fred.pp.fi> wrote:
Just noticed a 'hidden feature of Java' ;)
When I think of hidden Java features I think of secret accessor methods,
generics insanity, -XX switches, FinalReference, and in-place math
operators lacking narrowing checks.
FinalReference is new to me. Now i know what it is, but that's it - what
can you do with it?
Try to avoid them! When you override finalize(), each instantiation of
your object creates a Finalizer that's a subclass of FinalReference. A
Thread polls its ReferenceQueue and calls to finalize() during the GC
process. Overriding finalize(), even with an empty method, on
frequently created objects can be a catastrophic drain on performance
and memory.