Problem Description:
Running the app in Hadoop, there's arunning beyond virtual memory错误。提示如下:
Container [pid=28920,containerID=container_1389136889967_0001_01_000121] is running beyond virtual memory limits. Current usage: 1.2 GB of 1 GB physical memory used; 2.2 GB of 2.1 GB virtual memory used. Killing container.
原因:从机上运行的
Container试图使用过多的内存,而被
NodeManager kill off.
Excerpt The NodeManager is killing your container. It sounds like your trying to use Hadoop streaming which was running as a child process of the Map-reduce task. The NodeManager monitors the entire process tree of the task and if it eats up more memory than the maximum set in mapredu CE.MAP.MEMORY.MB or MAPREDUCE.REDUCE.MEMORY.MB respectively, we would expect the NodeManager to kill the task, otherwise y Our tasks are stealing memory belonging to other containers, which you don ' t want.
解决方法:
mapred-site.xml中设置map和reduce任务的内存配置如下:
<property>
<name>mapreduce.map.memory.mb</name>
<value>1536</value>
</property>
<property>
<name>mapreduce.map.java.opts</name>
<value>-Xmx1024M</value>
</property>
<property>
<name>mapreduce.reduce.memory.mb</name>
<value>3072</value>
</property>
<property>
<name>mapreduce.reduce.java.opts</name>
<value>-Xmx2560M</value>
</property>
附录:
Container is running beyond memory limits
http://stackoverflow.com/questions/21005643/container-is-running-beyond-memory-limits
"Hadoop" Running beyond virtual memory error causes and solutions