-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
11
A DESCRIPTION OF THE PROBLEM :
When looking at heap dumps I notice many byte[] objects being held on to by ZipFile within URLJarFile
for example:
byte[]#104406 : 2,055,296 items
<references>
->cen in java.util.zip.ZipFile$Source#1111
-->zsrc in java.util.zip.ZipFile$CleanableResource$FinalizableResource#564
--->res in sun.net.www.protocol.jar.URLJarFile#565 : /blah.war-_kg-any-14.dir/webapp/WEB-INF/lib/admin-api-client-swagger-generated-15.22.0-2...
Under the case of a long running apps it is the case that the likely hood that a class loader is going to need to load another class becomes lower and lower (or at least it is the case for me).
I propose that Java support a way in which Java developers can configure the class loader to release the byte[] held by ZipFile after some time/memory constraints and re-open/fetch that data from the zip file when the class loader is asked to load another class.
In my case I don't want to be wasting memory or data needed for a ZipFile within the class loader for jar files which I am very unlikely to load more classes from.
When looking at heap dumps I notice many byte[] objects being held on to by ZipFile within URLJarFile
for example:
byte[]#104406 : 2,055,296 items
<references>
->cen in java.util.zip.ZipFile$Source#1111
-->zsrc in java.util.zip.ZipFile$CleanableResource$FinalizableResource#564
--->res in sun.net.www.protocol.jar.URLJarFile#565 : /blah.war-_kg-any-14.dir/webapp/WEB-INF/lib/admin-api-client-swagger-generated-15.22.0-2...
Under the case of a long running apps it is the case that the likely hood that a class loader is going to need to load another class becomes lower and lower (or at least it is the case for me).
I propose that Java support a way in which Java developers can configure the class loader to release the byte[] held by ZipFile after some time/memory constraints and re-open/fetch that data from the zip file when the class loader is asked to load another class.
In my case I don't want to be wasting memory or data needed for a ZipFile within the class loader for jar files which I am very unlikely to load more classes from.