<?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: java.lang.OutOfMemoryError: Java heap space wih Flume in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148272#M110798</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/2686/zahermahdhi.html" nodeid="2686"&gt;@Zaher&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Depending on your data you should care about the channel you choose. The memory-channel is simple and easy, but data is lost when the Flume-agent crashes (OutOfMemory) most likely, or power/hardware-issues also likely... There are channels with higher durability for your data. The filechannel is very durable when underlaying storage is redundant as well. &lt;/P&gt;&lt;P&gt;Take a look at the &lt;A href="https://flume.apache.org/FlumeUserGuide.html#flume-channel-selectors"&gt;flume-channels&lt;/A&gt; and there configuration options.&lt;/P&gt;&lt;P&gt;For your OutOfMem-problem you can decrease the transaction and batch capacity and increase the heap in the flume-env config in Ambari as &lt;A rel="user" href="https://community.cloudera.com/users/193/mmiklavcic.html" nodeid="193"&gt;@Michael Miklavcic&lt;/A&gt; suggests.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2016 01:00:40 GMT</pubDate>
    <dc:creator>MrBee</dc:creator>
    <dc:date>2016-07-27T01:00:40Z</dc:date>
    <item>
      <title>java.lang.OutOfMemoryError: Java heap space wih Flume</title>
      <link>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148269#M110795</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using Flume to collect data from a Spool Directory. My configuration is as follows:&lt;/P&gt;&lt;PRE&gt;agent1.sources = source1
agent1.sinks = sink1
agent1.channels = channel2
agent1.sources.source1.channels = channel2
agent1.sinks.sink1.channel = channel2
agent1.sources.source1.type = spooldir
agent1.sources.source1.basenameHeader = true
agent1.sources.source1.spoolDir = /root/flume_example/spooldir

agent1.sinks.sink1.type = hdfs
agent1.sinks.sink1.hdfs.path = /user/root/flume
agent1.sinks.sink1.hdfs.filePrefix = %{basename}
agent1.sinks.sink1.hdfs.fileSuffix = .csv
agent1.sinks.sink1.hdfs.idleTimeout = 5


agent1.sinks.sink1.hdfs.rollSize = 0
agent1.sinks.sink1.hdfs.rollCount = 100000
agent1.sinks.sink1.hdfs.fileType = DataStream
agent1.channels.channel2.type = file		&lt;/PRE&gt;&lt;P&gt;When placing 43MB file in spooldir, flume starts writing files into HDFS Directory /user/root/flume: &lt;/P&gt;&lt;PRE&gt;-rw-r--r--   3 root hdfs      7.9 M 2016-07-26 11:10 /user/root/flume/filename.csv.1469524239209.csv
-rw-r--r--   3 root hdfs      7.6 M 2016-07-26 11:11 /user/root/flume/filename.csv.1469524239210.csv&lt;/PRE&gt;&lt;P&gt;But a java.lang.OutOfMemoryError: Java heap space error is raised:&lt;/P&gt;&lt;PRE&gt;ERROR channel.ChannelProcessor: Error while writing to required channel: FileChannel channel2 { dataDirs: [/root/.flume/file-channel/data] }
java.lang.OutOfMemoryError: Java heap space
    at java.util.HashMap.resize(HashMap.java:703)
    at java.util.HashMap.putVal(HashMap.java:662)
    at java.util.HashMap.put(HashMap.java:611)
    at org.apache.flume.channel.file.EventQueueBackingStoreFile.put(EventQueueBackingStoreFile.java:338)
    at org.apache.flume.channel.file.FlumeEventQueue.set(FlumeEventQueue.java:287)
    at org.apache.flume.channel.file.FlumeEventQueue.add(FlumeEventQueue.java:317)
    at org.apache.flume.channel.file.FlumeEventQueue.addTail(FlumeEventQueue.java:211)
    at org.apache.flume.channel.file.FileChannel$FileBackedTransaction.doCommit(FileChannel.java:553)
    at org.apache.flume.channel.BasicTransactionSemantics.commit(BasicTransactionSemantics.java:151)
    at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:192)
    at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:235)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
16/07/26 11:10:59 ERROR source.SpoolDirectorySource: FATAL: Spool Directory source source1: { spoolDir: /root/flume_example/spooldir }: Uncaught exception in SpoolDirectorySource thread. Restart or reconfigure Flume to continue processing.
java.lang.OutOfMemoryError: Java heap space
    at java.util.HashMap.resize(HashMap.java:703)
    at java.util.HashMap.putVal(HashMap.java:662)
    at java.util.HashMap.put(HashMap.java:611)
    at org.apache.flume.channel.file.EventQueueBackingStoreFile.put(EventQueueBackingStoreFile.java:338)
    at org.apache.flume.channel.file.FlumeEventQueue.set(FlumeEventQueue.java:287)
    at org.apache.flume.channel.file.FlumeEventQueue.add(FlumeEventQueue.java:317)
    at org.apache.flume.channel.file.FlumeEventQueue.addTail(FlumeEventQueue.java:211)
    at org.apache.flume.channel.file.FileChannel$FileBackedTransaction.doCommit(FileChannel.java:553)
    at org.apache.flume.channel.BasicTransactionSemantics.commit(BasicTransactionSemantics.java:151)
    at org.apache.flume.channel.ChannelProcessor.processEventBatch(ChannelProcessor.java:192)
    at org.apache.flume.source.SpoolDirectorySource$SpoolDirectoryRunnable.run(SpoolDirectorySource.java:235)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

&lt;/PRE&gt;&lt;P&gt;Any idea how can I fix this issue ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 16:28:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148269#M110795</guid>
      <dc:creator>zaher_mahdhi</dc:creator>
      <dc:date>2016-07-26T16:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.OutOfMemoryError: Java heap space wih Flume</title>
      <link>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148270#M110796</link>
      <description>&lt;P&gt;Problem solved, I changed the channel type from file to memory&lt;/P&gt;&lt;PRE&gt;agent1.channels.channel2.type = memory&lt;/PRE&gt;&lt;P&gt;Answers about how to make it work with a channel type file are welcome.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 17:52:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148270#M110796</guid>
      <dc:creator>zaher_mahdhi</dc:creator>
      <dc:date>2016-07-26T17:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.OutOfMemoryError: Java heap space wih Flume</title>
      <link>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148271#M110797</link>
      <description>&lt;P&gt;Default transactionCapacity for file channel is 10 000. For memory channel - 100&lt;/P&gt;&lt;P&gt;Thats why it works for you. Add transactionCapacity property to your file channel or increase memory available for flume process (like -Xmx1024m)&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 21:58:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148271#M110797</guid>
      <dc:creator>bluesmix</dc:creator>
      <dc:date>2016-07-26T21:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.OutOfMemoryError: Java heap space wih Flume</title>
      <link>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148272#M110798</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/2686/zahermahdhi.html" nodeid="2686"&gt;@Zaher&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Depending on your data you should care about the channel you choose. The memory-channel is simple and easy, but data is lost when the Flume-agent crashes (OutOfMemory) most likely, or power/hardware-issues also likely... There are channels with higher durability for your data. The filechannel is very durable when underlaying storage is redundant as well. &lt;/P&gt;&lt;P&gt;Take a look at the &lt;A href="https://flume.apache.org/FlumeUserGuide.html#flume-channel-selectors"&gt;flume-channels&lt;/A&gt; and there configuration options.&lt;/P&gt;&lt;P&gt;For your OutOfMem-problem you can decrease the transaction and batch capacity and increase the heap in the flume-env config in Ambari as &lt;A rel="user" href="https://community.cloudera.com/users/193/mmiklavcic.html" nodeid="193"&gt;@Michael Miklavcic&lt;/A&gt; suggests.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 01:00:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148272#M110798</guid>
      <dc:creator>MrBee</dc:creator>
      <dc:date>2016-07-27T01:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.OutOfMemoryError: Java heap space wih Flume</title>
      <link>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148273#M110799</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/2167/bluesmix.html" nodeid="2167"&gt;@Michael M&lt;/A&gt;&lt;A rel="user" href="https://community.cloudera.com/users/7424/alexanderbij.html" nodeid="7424"&gt;&lt;/A&gt; and &lt;A rel="user" href="https://community.cloudera.com/users/7424/alexanderbij.html" nodeid="7424"&gt;@Alexander Bij&lt;/A&gt; for your valuable help.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 16:17:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/java-lang-OutOfMemoryError-Java-heap-space-wih-Flume/m-p/148273#M110799</guid>
      <dc:creator>zaher_mahdhi</dc:creator>
      <dc:date>2016-07-27T16:17:25Z</dc:date>
    </item>
  </channel>
</rss>

