<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NIFI-Heap Accumulation Issue in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Heap-Accumulation-Issue/m-p/394954#M248834</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/116468"&gt;@Krish98&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Most NiFi Heap memory issues are directly related to dataflow design.&amp;nbsp; The Apache NiFi documentation for the individual components generally does a good job with reporting "System Resource Considerations".&amp;nbsp; So the first step would be to review the documentation for the components you are using to see which list "MEMORY" as system resource consideration.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;A class="component-link" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.27.0/org.apache.nifi.processors.standard.SplitContent/index.html" target="component-usage"&gt;SplitContent&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="version"&gt;1.27.0&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1728578086371.png" style="width: 710px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42089iB5FE14A338CF4158/image-dimensions/710x165?v=v2" width="710" height="165" role="button" title="MattWho_0-1728578086371.png" alt="MattWho_0-1728578086371.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then sharing your configuration of those components&amp;nbsp; might help with providing suggestions that may help you.&lt;BR /&gt;&lt;BR /&gt;- Split and Merge processor depending on how they are configured can utilize a lot of heap.&lt;BR /&gt;-&amp;nbsp;Distributed Map cache also resides in HEAP and can contribute to to significant heap usage depending on configuration and the size of what is being written to it.&lt;BR /&gt;&lt;BR /&gt;Beyond components:&lt;BR /&gt;- NiFi loads the entire flow.json.gz (uncompressed it to heap memory).&amp;nbsp; This includes any NiFi Templates (Deprecated in Apache NiFi 1.x and removed in newer Apache NiFi 2.x version).&amp;nbsp; Templates should no longer be used.&amp;nbsp; Any templates created which are listed in the NiFi templates UI should be downloaded so they are stored outside of NiFi and then deleted from NiFi to reduce heap usage.&lt;BR /&gt;- NiFi FlowFiles - NiFi FlowFlowFiles are what transition between components via connections in your dataflow(s).&amp;nbsp; A FlowFile consists of two parts.&amp;nbsp; FlowFile content stored in content claims in the content_repository and FlowFile metadata/attributes held in heap memory and persisted to flowfile_repository.&amp;nbsp; So if you are creating a lot of FlowFile attributes on your FlowFiles or creating very large FlowFile attributes (like extract content to an attribute), that can result in high heap usage.&amp;nbsp; &amp;nbsp;A connection does have a default threshold at which time a swap file is created to reduce heap usage.&amp;nbsp; Swap files are created with 10,000 FlowFiles in each swap file.&amp;nbsp; The first swap file would not be created until a connection on a specific node reached 20,000 at which point 10,000 would be moved to a swap file and the 10,000 highest priority would remain in heap.&amp;nbsp; The default "back pressure object threshold" on a connection is 10,000 meaning that with defaults no connection would ever create a swap file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2024 16:54:03 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2024-10-10T16:54:03Z</dc:date>
    <item>
      <title>NIFI-Heap Accumulation Issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Heap-Accumulation-Issue/m-p/394857#M248816</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;Currently i am using 5 node cluster of NIFI -&amp;nbsp; 1.27 version.&lt;BR /&gt;node have 47 Gb RAM&lt;/P&gt;&lt;P&gt;My NIFI heap memory level keep on increasing and crashing by reaching 150 hours.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krish98_0-1728459737160.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42056iD548C6136F9963D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Krish98_0-1728459737160.png" alt="Krish98_0-1728459737160.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Frequency of data is around 100 Gb in a day.&lt;/P&gt;&lt;P&gt;I am using variety of&amp;nbsp; processors (Kafka, split and merge , distributed cache processors,Attribute level processors, hive3streaming processor,(select and put)Execute SQL (postgre,SSIS),Kudu processor etc).&lt;/P&gt;&lt;P&gt;Please find&amp;nbsp; nifi properties below:&lt;/P&gt;&lt;P&gt;# JVM memory settings&lt;/P&gt;&lt;P&gt;java.arg.2=-Xms16g&lt;/P&gt;&lt;P&gt;java.arg.3=-Xmx20g&lt;/P&gt;&lt;P&gt;java.arg.7=-XX:ReservedCodeCacheSize=512m&lt;/P&gt;&lt;P&gt;java.arg.9=-XX:+UseCodeCacheFlushing&lt;/P&gt;&lt;P&gt;java.arg.23=-XX:ParallelGCThreads=8&lt;/P&gt;&lt;P&gt;java.arg.24=-XX:ConcGCThreads=4&lt;/P&gt;&lt;P&gt;java.arg.25=-XX:G1ReservePercent=10&lt;/P&gt;&lt;P&gt;java.arg.26=-XX:+UseStringDeduplication&lt;/P&gt;&lt;P&gt;java.arg.27=-XX:InitiatingHeapOccupancyPercent=25&lt;/P&gt;&lt;P&gt;java.arg.28=-XX:MaxGCPauseMillis=200&lt;/P&gt;&lt;P&gt;java.arg.40=-XX:SurvivorRatio=8&lt;/P&gt;&lt;P&gt;java.arg.41=-XX:NewRatio=3&lt;/P&gt;&lt;P&gt;java.arg.42=-Xmn6g&lt;/P&gt;&lt;P&gt;java.arg.13=-XX:+UseG1GC&lt;/P&gt;&lt;P&gt;nifi.content.repository.archive.max.retention.period=7 hours&lt;/P&gt;&lt;P&gt;nifi.content.repository.archive.max.usage.percentage=50%&lt;/P&gt;&lt;P&gt;nifi.provenance.repository.max.storage.time=30 hours&lt;/P&gt;&lt;P&gt;nifi.provenance.repository.max.storage.size=10 GB&lt;/P&gt;&lt;P&gt;nifi.provenance.repository.rollover.time=10 mins&lt;/P&gt;&lt;P&gt;nifi.provenance.repository.rollover.size=100 MB&lt;/P&gt;&lt;P&gt;nifi.provenance.repository.query.threads=2&lt;/P&gt;&lt;P&gt;nifi.provenance.repository.index.threads=2&lt;/P&gt;&lt;P&gt;nifi.queue.swap.threshold=10000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tagging&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp; for quick response&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Krish&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 04:02:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Heap-Accumulation-Issue/m-p/394857#M248816</guid>
      <dc:creator>Krish98</dc:creator>
      <dc:date>2024-10-10T04:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI-Heap Accumulation Issue</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Heap-Accumulation-Issue/m-p/394954#M248834</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/116468"&gt;@Krish98&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Most NiFi Heap memory issues are directly related to dataflow design.&amp;nbsp; The Apache NiFi documentation for the individual components generally does a good job with reporting "System Resource Considerations".&amp;nbsp; So the first step would be to review the documentation for the components you are using to see which list "MEMORY" as system resource consideration.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;A class="component-link" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.27.0/org.apache.nifi.processors.standard.SplitContent/index.html" target="component-usage"&gt;SplitContent&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="version"&gt;1.27.0&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1728578086371.png" style="width: 710px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/42089iB5FE14A338CF4158/image-dimensions/710x165?v=v2" width="710" height="165" role="button" title="MattWho_0-1728578086371.png" alt="MattWho_0-1728578086371.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then sharing your configuration of those components&amp;nbsp; might help with providing suggestions that may help you.&lt;BR /&gt;&lt;BR /&gt;- Split and Merge processor depending on how they are configured can utilize a lot of heap.&lt;BR /&gt;-&amp;nbsp;Distributed Map cache also resides in HEAP and can contribute to to significant heap usage depending on configuration and the size of what is being written to it.&lt;BR /&gt;&lt;BR /&gt;Beyond components:&lt;BR /&gt;- NiFi loads the entire flow.json.gz (uncompressed it to heap memory).&amp;nbsp; This includes any NiFi Templates (Deprecated in Apache NiFi 1.x and removed in newer Apache NiFi 2.x version).&amp;nbsp; Templates should no longer be used.&amp;nbsp; Any templates created which are listed in the NiFi templates UI should be downloaded so they are stored outside of NiFi and then deleted from NiFi to reduce heap usage.&lt;BR /&gt;- NiFi FlowFiles - NiFi FlowFlowFiles are what transition between components via connections in your dataflow(s).&amp;nbsp; A FlowFile consists of two parts.&amp;nbsp; FlowFile content stored in content claims in the content_repository and FlowFile metadata/attributes held in heap memory and persisted to flowfile_repository.&amp;nbsp; So if you are creating a lot of FlowFile attributes on your FlowFiles or creating very large FlowFile attributes (like extract content to an attribute), that can result in high heap usage.&amp;nbsp; &amp;nbsp;A connection does have a default threshold at which time a swap file is created to reduce heap usage.&amp;nbsp; Swap files are created with 10,000 FlowFiles in each swap file.&amp;nbsp; The first swap file would not be created until a connection on a specific node reached 20,000 at which point 10,000 would be moved to a swap file and the 10,000 highest priority would remain in heap.&amp;nbsp; The default "back pressure object threshold" on a connection is 10,000 meaning that with defaults no connection would ever create a swap file.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 16:54:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Heap-Accumulation-Issue/m-p/394954#M248834</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-10-10T16:54:03Z</dc:date>
    </item>
  </channel>
</rss>

