OOM_killer

OOM killer

只跑一個 app 的系統的解法:
echo 90 > /proc/sys/vm/overcommit_ratio
echo 2 > /proc/sys/vm/overcommit_memory
見:http://lxr.linux.no/linux/Documentation/vm/overcommit-accounting

系統要跑多個『非專家寫的』、『不在你控制下的』 app 時,就要學 Android 改 kernel 這部份的 policy 了:http://git.linaro.org/gitweb?p=people/jstultz/android-dev.git;a=blob;f=drivers/staging/android/lowmemorykiller.c;h=052b43e4e505148aa0da8b4da5b611da85b5dd3c;hb=624b225035b24e9d7c22cc214f449fc2ec2491c9

也可以用 /proc/[pid]/oom_adj (see man proc):
"plus the special value -17, which disables OOM-killing altogether for
this process."

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License