Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-3894

NiFi Crashes with OOM if compression is enabled on an RPG with high number of FlowFiles

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.0, 1.2.0
    • 1.3.0
    • Core Framework
    • None

    Description

      RemoteProcessGroup can be configured to use compression per port. OutOfMemoryError occurred with a large amount of FlowFiles queued in an output port and a NiFi S2S client pulled those via RPG with compression enabled. Without compression, the same amount of FlowFiles can be transferred without issue. Here is the stack trace:

      2017-04-06 18:21:59,063 WARN [Timer-Driven Process Thread-5] o.a.n.c.t.ContinuallyRunConnectableTask StandardRootGroupPort[id=cc3ad50e-0159-1000-0000-00001c8cf0ef] Administratively Pausing for 10 seconds due to processing failure: java.lang.OutOfMemoryError 
      java.lang.OutOfMemoryError: null 
      at java.util.zip.Deflater.init(Native Method) ~[na:1.8.0_77] 
      at java.util.zip.Deflater.<init>(Deflater.java:171) ~[na:1.8.0_77] 
      at java.util.zip.Deflater.<init>(Deflater.java:180) ~[na:1.8.0_77] 
      at org.apache.nifi.remote.io.CompressionOutputStream.<init>(CompressionOutputStream.java:54) ~[nifi-utils-1.1.0.2.1.1.0-2.jar:1.1.0.2.1.1.0-2] 
      

      It happens because CompressionOutputStream.close does not call end() method of a Deflater It calls resets() but not end().
      https://github.com/apache/nifi/blob/master/nifi-commons/nifi-utils/src/main/java/org/apache/nifi/remote/io/CompressionOutputStream.java#L141

      The issue is the same with this:
      JDK-4797189 : Finalizers not called promptly enough
      http://bugs.java.com/view_bug.do?bug_id=4797189

      WORK AROUND
      Invoke "end()" on any Inflator or Deflator once it is no longer in use. This will clean up the process space (non Java/GC) memory.

      Attachments

        Activity

          People

            ijokarumawak Koji Kawamura
            ijokarumawak Koji Kawamura
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: