Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8223401

Inefficiency in ZipFileSystem.sync()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      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); <<<<<<<

            Unassigned Unassigned
            jiangli Jiangli Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: