geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevan Miller <>
Subject Workaround for URLJarFile memory leak
Date Fri, 11 Nov 2005 16:06:29 GMT
As I mentioned previously, there is a memory leak of URLJarFile instances in
Geronimo. The problem is caused by -- will hold onto strong references to
all URLJarFile instances. So URLJarFiles can never be GCed. This means that
for every deploy/undeploy of an application, you'll leak URLJarFiles.

The problem can be avoided by calling URLConnection.setDefaultUseCaches(false);
This will turn off the caching in JarFileFactory. I added a call to
setDefaultUseCaches() to DeploymentUtil.readAll() and verified that Geronimo
no longer leaks URLJarFile instances.

Note that setDefaultUseCaches(false) is a "global" setting. So it affects
the entire runtime. URLConnection.setUseCaches(false) does not fix the
problem. Since, there is the potential for a performance impact, I thought
I'd advertise the issue. I don't see any usages within Geronimo code where
this would cause major problems. However, there may be issues which I'm not

Comments? Barring concerns, I'll raise a Jira and post a patch.


View raw message