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

Inefficiency in ZipFileSystem.sync()

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: