Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-354

GzipCompressionProvider leaks native memory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 3.2.1, 2.11.1
    • None
    • None

    Description

      Both compress and decompress instantiate GZIP streams, use them, and don't close them. The java util deflate/inflate streams use JNI to leverage zlib, including the allocation of a native, off-heap buffer.

      These JNI buffer handles are released when the containing stream is closed. They're also released by the finalize() method on java.util.zip.Inflater/Deflater, but it looks as if the native memory can pile up quickly enough in certain use cases where the JVM is OOM killed before the finalizer does its thing.

      Fix is to explicitly close these streams after they're used.

      This was discovered in version 2.11.0, but it looks like the problem affects all versions for which GzipCompressionProvider existed.

      Attachments

        1. RSS before and after fix.png
          57 kB
          Evan Pollan

        Issue Links

          Activity

            People

              randgalt Jordan Zimmerman
              epollan Evan Pollan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: