Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Container is running beyond virtual memory limits

When I do rhadoop example, below errors are occurred.

is running beyond virtual memory limits. Current usage: 121.2 MB of 1 GB physical memory used; 2.1 GB of 2.1 GB virtual memory used. Killing container.

Container killed on request. Exit code is 143

Container exited with a non-zero exit code 143

hadoop streaming failed with error code 1

How can I fix it?

My hadoop settings.

mapred-site.xml

<configuration>
        <property>
                <name>mapreduce.framework.name</name>
                <value>yarn</value>
        </property>
</configuration>

yarn-site.xml

<configuration>

<!-- Site specific YARN configuration properties -->
        <property>
                <name>yarn.nodemanager.aux-services</name>
                <value>mapreduce_shuffle</value>
        </property>
        <property>
                <name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>
                <value>org.apache.hadoop.mapred.ShuffleHandler</value>
        </property>
        <property>
                <name>yarn.nodemanager.local-dirs</name>
                <value>/usr/local/hadoop-2.7.3/data/yarn/nm-local-dir</value>
        </property>
        <property>
                <name>yarn.resourcemanager.fs.state-store.uri</name>
                <value>/usr/local/hadoop-2.7.3/data/yarn/system/rmstore</value>
        </property>
        <property>
                <name>yarn.resourcemanager.hostname</name>
                <value>localhost</value>
        </property>
        <property>
                <name>yarn.web-proxy.address</name>
                <value>0.0.0.0:8089</value>
        </property>
</configuration>
like image 446
yes89929 Avatar asked Apr 16 '17 19:04

yes89929


People also ask

Does virtual memory have a limit?

Therefore, each application has a virtual memory limit of 2 GB, regardless of physical RAM. No process can ever address more than 2 GB of virtual address space by default. Exceeding this limit produces an out-of-virtual-memory error and can occur even when there is plenty of physical memory available.

Why is virtual memory infinite?

Virtual memory is not exactly limited by disk space, it can be allocated but not mapped, so-called "reserved virtual memory".

What is yarn Nodemanager VMEM Pmem ratio?

yarn.nodemanager.vmem-pmem-ratioDefines a ratio of allowed virtual memory compared to physical memory. This ratio simply defines how much virtual memory a process can use but the actual tracked size is always calculated from a physical memory limit.

What is Mapreduce map memory MB?

mapreduce.map.memory.mb -1 The amount of memory to. request from. the. scheduler. for each map task. If this is not specified or is non-positive, it is inferred from mapreduce.map.java.opts and mapreduce.job.heap.memory-mb.


2 Answers

I got almost same error while running a Spark application on YARN cluster.

"Container [pid=791,containerID=container_1499942756442_0001_02_000001] is running beyond virtual memory limits. Current usage: 135.4 MB of 1 GB physical memory used; 2.1 GB of 2.1 GB virtual memory used. Killing container."

I resolved it by disabling virtual memory check in the file yarn-site.xml

<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>

This one setting was enough in my case.

like image 105
Anurag Avatar answered Oct 16 '22 22:10

Anurag


I referred below site. http://crazyadmins.com/tag/tuning-yarn-to-get-maximum-performance/

Then I got to know that I can change memory allocation of mapreduce.

I changed mapred-site.xml

<configuration>
        <property>
                <name>mapreduce.framework.name</name>
                <value>yarn</value>
        </property>
        <property>
                <name>mapreduce.map.memory.mb</name>
                <value>2000</value>
        </property>
        <property>
                <name>mapreduce.reduce.memory.mb</name>
                <value>2000</value>
        </property>
        <property>
                <name>mapreduce.map.java.opts</name>
                <value>1600</value>
        </property>
        <property>
                <name>mapreduce.reduce.java.opts</name>
                <value>1600</value>
        </property>
</configuration>
like image 25
yes89929 Avatar answered Oct 16 '22 22:10

yes89929