tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Kriger <andy.kri...@gmail.com>
Subject RE: finalize question
Date Wed, 02 Nov 2005 18:43:07 GMT
>> From: Andy Kriger [mailto:andy.kriger@gmail.com]
>> Subject: finalize question
>>
>> Problem is, I'm not seeing any finalize methods being called.
>
> Reliance on finalizers is a sign of extremely poor application design.
> First, it can be a significant performance hit, since objects with
> finalizers have to be handled specially both by allocation and garbage
> collection.  Second, there's no guarantee that a finalizer will _ever_
> be called, so if you're dependent on that happening, you're in trouble
> right from the start.  Much better to design your app with discrete
> event handling and not leave it up to the whims of the garbage
> collector.
>
>  - Chuck

I must not have been clear in my original message - I'm not relying on
finalizers in my application design. I don't use them at all generally.

I was hoping that I could use AOP to log whenever a finalizer was called
so I could see if there were any glaring instances of an object not getting
gc'd. This is purely a debugging situation.

thx
andy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message