Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As soon as I figure out how to get the OOM killer to just kill Chrome every time, I might never have to hard reset my system again!


You are looking for /proc/<pid>/oom_score_adj:

https://github.com/torvalds/linux/blob/15a2bc4dbb9cfed1c661a...


Curiously, in https://bugs.chromium.org/p/chromium/issues/detail?id=333617 people are complaining about the opposite problem:

Linux kills a Chromium process, leaving bigger memory hogs roaming around.


On Ubuntu, earlyoom basically does that. It's great.

  sudo apt install earlyoom


Looks brilliant, thank you!


I’ve case you are serious, replace chrome with:

  #!/bin/bash
  echo 1000 > /proc/$$/oom_score_adj
  path_to_real_chrome


What's the maintainable way of doing this, that can survive chrome package updates and also handle http URIs opened from other applications?


How do you typically start chrome? I guess you could just change the .desktop file somewhere in $HOME, system updates don't touch that.


Won't that just OOM-shield the shell launching chrome and not the chrome process itself?

I think you want "exec path_to_real_chrome".




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: