NativeのOOM Killer 避け関数
以下のような記述有り。
frameworks/base/cmds/dumpstate/utils.c にあった。
/* prevents the OOM killer from killing us */
void protect_from_oom_killer()
{
int fd;fd = open("/proc/self/oom_adj", O_WRONLY);
if (fd >= 0) {
// -17 should make us immune to OOM
const char* text = "-17";
write(fd, text, strlen(text));
close(fd);
}
}