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

ZipFileInflaterInputStream should release its Inflater after observing EOF

XMLWordPrintable

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

      ZipFile maintains a pool of Inflater objects. Inflaters are released back to the pool when the input stream is explicitly closed, when the input stream instance is no longer strongly reachable, or when the ZipFile is closed.

      In use cases such as class loaders, a ZipFile may be kept open for the life time of the application. In such cases, if client code consumes input streams without closing them (explicitly or via TwR), then a large number of Inflater issues may be created before GC starts returning them to the pool.

      To reduce the number of pooled Inflater instances that are kept alive, it would be benefitial if ZipFileInflaterInputStream would release the Inflater when it observes an EOF (the client has fully consumed the stream).

            eirbjo Eirik Bjørsnøs
            eirbjo Eirik Bjørsnøs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: