Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Resource leak with URLResource?

Hi Jens,

The jvm can cache URL connections, such as JarUrlConnections and also
JarFile entries. By default, caching is enabled.  So, even if the
Resource was closed, because caching is enabled, the jvm will still
hold onto a reference to your url connection. You can try calling
Resource.setDefaultUseCaches(false) to disable caching, and you should
see that even without an explicit close, garbage collection should
eventually get rid of the URL connection/JarFile entries etc.

That said, I've opened an issue to look at any places in the code such
as this that we could call Resource.close():
https://bugs.eclipse.org/bugs/show_bug.cgi?id=465864

Jan


Back to the top