News for hackers. Stuff that matters.
Re:In defence of swap: common misconceptions by altmind on Monday June 08, 2020 @10:50PM (#23463150)
While I find the question puzzling, i find the description lacking. The whole explanation of anon maps is redundant, since the behavior of anon maps seems to be the same as the behavior of plain memory - its evicted on low memory conditions with LRU behavior and there is no anon maps specifics mentioned.

To recap: swap makes anon memory pages reclaimable, by offloading it to disk. This does not explain anything. Its basically "swap allows anon maps to be swapped"; so what?

>> You need to opportunistically handle the situation yourself before ever thinking about the OOM killer.

Or, just rely on OOM killer, minimal swap(so the application dont agony in low memory conditions) and restart policies. There are no reason to do the kernel work handling memory over-commit.

Re:In defence of swap: common misconceptions by lostdog on Tuesday June 09, 2020 @12:48AM (#23463744)
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!
Re:In defence of swap: common misconceptions by cbsks on Tuesday June 09, 2020 @01:35AM (#23463959)
You are looking for /proc/<pid>/oom_score_adj:

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

Re:In defence of swap: common misconceptions by jwilk on Tuesday June 09, 2020 @03:23AM (#23464519)
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.

Re:In defence of swap: common misconceptions by z991 on Tuesday June 09, 2020 @01:44AM (#23464023)
On Ubuntu, earlyoom basically does that. It's great.

  sudo apt install earlyoom
Re:In defence of swap: common misconceptions by lostdog on Tuesday June 09, 2020 @11:04PM (#23473476)
Looks brilliant, thank you!
Re:In defence of swap: common misconceptions by hinoki on Tuesday June 09, 2020 @02:45AM (#23464326)
I’ve case you are serious, replace chrome with:

  #!/bin/bash
  echo 1000 > /proc/$$/oom_score_adj
  path_to_real_chrome
Re:In defence of swap: common misconceptions by mappu on Tuesday June 09, 2020 @03:51AM (#23464652)
What's the maintainable way of doing this, that can survive chrome package updates and also handle http URIs opened from other applications?
Re:In defence of swap: common misconceptions by steerablesafe on Tuesday June 09, 2020 @03:55AM (#23464666)
How do you typically start chrome? I guess you could just change the .desktop file somewhere in $HOME, system updates don't touch that.
Re:In defence of swap: common misconceptions by zbentley on Wednesday June 10, 2020 @02:27AM (#23474535)
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".