jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: Shutdown hooks and classloader leak
Date Fri, 30 May 2008 05:47:04 GMT
Hi,

Am Mittwoch, den 28.05.2008, 14:52 +0200 schrieb Stefan Guggisberg:
> On Wed, May 28, 2008 at 12:33 PM, Roman Puchkovskiy
> <roman.puchkovskiy@blandware.com> wrote:
> >
> > Hi.
> >
> > Some classes in Jackrabbit (for instance, TransientFileFactory) always
> > register shutdown hooks. So, if jackrabbit classes were loaded by web-app
> > classloader, they will not be released when web-app is undeployed. Looks
> > like this should lead to classloader leak.
> > Am I missing something? And if this causes leaks, is there way to cancel
> > such hooks when undeploying web-application?
> 
> is this a pure theoretical issue or have you actually experienced
> "out of perm space" errors?

I consider cleaning up behind onseself is good programming practice.
Leaving the TransientFileFactory instance hanging around just like that
after going away is IMHO bad behaviour (Properly depending on GC is of
course one kind of cleaning up).

Probably the TransientFileFactory should have a functionality to clean
up when not used anymore, which would include cleaning any moribund
files and removing the shutdown hook.

Regards
Felix

> 
> i agree with your analysis that the addShutdownHook call in
> TransientFileFactory is a potential classloader related memory
> leak. however, so far i haven't heard of any "out of perm space"
> reports.
> 
> OTOH, if this is a real world issue we should probably address it.
> 
> BTW: TransientFileFactory is part of jcr-commons which could/should
> be deployed as a shared library.
> 
> cheers
> stefan
> 
> >
> > Thanks in advance.
> > --
> > View this message in context: http://www.nabble.com/Shutdown-hooks-and-classloader-leak-tp17509737p17509737.html
> > Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
> >
> >


Mime
View raw message