title: setting hadoop mapreduce size without mapred-site.xml
body: <p>I am running a mapreduce job on server and am constantly getting this error:</p>
  
  <pre><code>Container killed on request. Exit code is 143
  Container exited with a non-zero exit code 143
  Container is running beyond physical memory limits. Current usage: 1.0 
  GB of 1 GB physical memory used; 2.7 GB of 2.1 GB virtual memory used. 
  Killing container.
  </code></pre>
  
  <p>Of course I have read all possible resources and I know that I need to set the config in these files:  <strong>mapred-site.xml \\ yarn-site.xml</strong></p>
  
  <p>But our server doesn't let me to overwrite those properties and I want an approach to do it in terminal or in config of my hadoop program.</p>
  
  <p>I was running this job with hive and I was able to overwrite these properties like this:</p>
  
  <pre><code>set HADOOP_HEAPSIZE=4096;
  set mapreduce.reduce.memory.mb = 4096;
  set mapreduce.map.memory.mb = 4096;
  set tez.am.resource.memory.mb=4096;
  set yarn.app.mapreduce.am.resource.mb=4096;
  </code></pre>
  
  <p>But when I am writing a map reduce program instead of hive query, how can I change these?</p>
  
  <p>How can I export mapreduce.reduce.memory.mb in shell for example?</p>