问题
Good Afternoon, I'm having trouble increasing the Heap Size for Flume. As a result, I get:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
I've increased the heap defined in "flume-env.sh" as well as Hadoop/Yarn. No luck.
One thing to notice, on starting flume, the Exec (processbuilder?) seems to be defining heap as 20Mb. Any ideas on how to override it?
Info: Including Hadoop libraries found via (/usr/local/hadoop/bin/hadoop) for HDFS access
Info: Including Hive libraries found via () for Hive access
+ exec /usr/lib/jvm/java-9-openjdk-amd64/bin/java -Xmx20m -cp 'conf:/usr/local/flume/lib/* :
........
Ultimately I'm trying to set Heapsize to 1512MB.
回答1:
Increasing the heap in "flume_env.sh" should work. You can also try executing your Flume agent as follows:
flume-ng agent -n myagent -Xmx512m
Flume is able to read -D and -X options from the command line.
来源:https://stackoverflow.com/questions/56997665/increase-flume-maxheap