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

(zipfs) Memory leak in ZipFileSystem.releaseDeflater()

    XMLWordPrintable

Details

    • b24
    • Verified

    Backports

      Description

        ZipFileSystem caches MAX_FLATER (currently 20) Inflater/Deflater objects. However the logic for reusing Deflaters is wrong because it references the Inflater List when checking against the number of already cached objects. This seems like a day-one copy and paste error.

        Notice that this issue is not as critical as it appears, because retaining of additional Deflaters only happens when more than MAX_FLATER are used and released concurrently. I.e. the maximum number of cached Deflaters is the maximal number of Deflaters that are released while no new Deflater is requested. In practice this is usually still a small number, less than MAX_FLATERS. Nevertheless we can easily construct an example which demonstrates the memory leak and because the fix is trivial we should really fix this.

        Attachments

          Issue Links

            Activity

              People

                simonis Volker Simonis
                simonis Volker Simonis
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: