dev@grizzly.java.net

Re: Grizzly's 2.0 Slab.finalize() ?

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Thu, 12 Feb 2009 14:20:05 +0100

Hi Charlie,

> I haven't had a chance to look in detail at the implementation
> details of the SlabMemoryManager and how it's used. But, I did
> notice in the object diagram for Slab, a finalize() method.
> Depending on how Slab and the classes that inherit Slab are used, we
> might consider looking into the possibility of migrating to using a
> "ReferenceQueue" approach to clean things up rather than using
> finalize().
>
> finalize() can be problematic in that it may take several gc events
> for an object with a finalize() method to get collected.
I see, currently we override finalize just for statistics reasons (we
calculate total amount of reclaimed memory). In this case, IMHO, we
can just make sure, that even if finalize() is called several times
for single object - we will calculate statistics right way.

Thanks.

WBR,
Alexey.

>
>
> charlie ...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>