title: How to disable the oom killer in linux?
body: <p>My current configs are:</p>
  
  <pre><code>&gt; cat /proc/sys/vm/panic_on_oom
  0
  &gt; cat /proc/sys/vm/oom_kill_allocating_task
  0
  &gt; cat /proc/sys/vm/overcommit_memory
  1
  </code></pre>
  
  <p>but when I run a task, it's killed anyway.</p>
  
  <pre><code>&gt; ./test/mem.sh
  Killed
  &gt; dmesg | tail -2
  [24281.788131] Memory cgroup out of memory: Kill process 10565 (bash) score 1001 or sacrifice child
  [24281.788133] Killed process 10565 (bash) total-vm:12601088kB, anon-rss:5242544kB, file-rss:64kB
  </code></pre>
  
  <h2>Update</h2>
  
  <p>My tasks are used to scientific computing, which costs many memories, it seems that <code>overcommit_memory=1</code> may be the best choice.</p>
  
  <h2>Update 2</h2>
  
  <p>Actually, I'm working on a data analyzation project, which costs memory more than <code>16G</code>, but I was asked to limit them in about <code>5G</code>. It might be impossible to implement this requirement via optimizing the program itself, because the project uses many sub-commands, and most of them does not contains options like <code>Xms</code> or <code>Xmx</code> in Java. </p>
  
  <h2>Update 3</h2>
  
  <p><a href="https://stackoverflow.com/questions/35695261/how-does-the-container-use-more-memory-than-the-limit">My project</a> should be an overcommited system. Exacetly as what <a href="https://stackoverflow.com/users/1257035/a3f">a3f</a> saying, it seems that my apps prefer to crash by <code>xmalloc</code> when mem allocated failed.</p>
  
  <pre><code>&gt; cat /proc/sys/vm/overcommit_memory
  2
  &gt; ./test/mem.sh
  ./test/mem.sh: xmalloc: .././subst.c:3542: cannot allocate 1073741825 bytes (4295237632 bytes allocated)
  </code></pre>
  
  <p>I don't want to surrender, although so many aweful tests make me exhausted.
  So please show me a way to the light ; )</p>