Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-11753

CatalogD OOMkilled due to natively allocated memory

    XMLWordPrintableJSON

Details

    Description

      We can hit this bug in several installations: https://bugs.openjdk.org/browse/JDK-8257032
      (another nice description of the issue can be found here: https://medium.com/swlh/native-memory-the-silent-jvm-killer-595913cba8e7)

      The problem is that we are creating our own Deflater object and pass it to the constructor of DeflaterOutputStream:
      https://github.com/apache/impala/blob/84fa6d210d3966e5ece8b4ac84ff8bd8780dec4e/fe/src/main/java/org/apache/impala/util/CompressionUtil.java#L47

      This means that Java's DeflaterOutputStream won't assume ownership on the Deflater, and won't invoke its end() method:

      The Deflater's methods are implemented in C and allocate native memory. This means that until the GC doesn't destroy the unreachable Deflater objects they can consume quite much native memory. In some scenarios it can even result in OOMKills by the kernel.

      We should solve this issue by either

      • override close() of DeflaterOutputStream (like mentioned in the above blog post)
      • directly invoke end() on the Deflater object in a finally clause

      Attachments

        Activity

          People

            boroknagyz Zoltán Borók-Nagy
            boroknagyz Zoltán Borók-Nagy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: