JDK-8034802 re-implemented ZipFileSystem.sync(). The new implementation creates a separate OutputStream object (EntryOutputStreamCRC32 or EntryOutputStreamDef) for each entry. For a JAR file with large number of entries, this causes many short lived objects being created. The older version of ZipFileSystem.sync() does not seem to use a separate resource for each entry in the deflated case:
- if (e.bytes != null) { // in-memory, deflated
- os.write(e.bytes); // already
- written += e.bytes.length;
- } else if (e.file != null) { // tmp file
...
- }
+ written += writeEntry(e, os, buf); <<<<<<<