Why is Java11 keeping java.util.zip.ZipFile$Source on heap?

Poreba, Tomasz Tomasz.Poreba at siemens-logistics.com
Fri Mar 27 10:27:53 UTC 2020

I noticed that after migrating a Java app from JDK8 to JDK11 a significant portion of heap is being used up by some data related to my jars from the classpath.
These are byte[] from java.util.zip.ZipFile$Source (field "cen"), it appears that static map "files" keeps them.

Is it deliberate?

I couldn't post it to OpenJDK bug tracker, so I described the issue in detail here: https://stackoverflow.com/questions/60835946/why-is-java11-keeping-java-util-zip-zipfilesource-on-heap
Tomasz Poręba

More information about the discuss mailing list