[Discussion] Oom Killer fine tuning (overcommit_ratio value)
As for Update 10 I saw many unhappy with the memory killer kicking in to much and kill applications. As I also had this on christmas eve and it buged me I messed a little around with the settings. Just like on the old vm.swappiness thread which brought many interesting suggestions. I also like to discuss the fine tuning of the OOMKiller behavior.
As I see it currently the main setting for the OOMKiller can be set in /proc/sys/vm/overcommit_ratio. It is default to the value 50.
What does this mean ? This value is a percentage value that is used in the following equation. The result of that equation is the maximum for every app to take before OOMKiller starts kicking in and killing applications.
(50% * RAM Size) + SWAP Space By default on update 10 this value should be around 1 GB if I am not mistaken. (811 MB * 0.5 + 613 MB)
By raising the value more general memory (swap + ram) can be used until OOM Killer kicks in.
I raised it to even 90% but I am not sure if this is a good idea as I only opened up 4 Browser Tabs (Sailfish-Browser) + media player + calculator + Warehouse + Terminal + Jolla Store + MeeCast + Settings
I am not sure if any app gets killed when I now get a call or if it will lag. At least I still feel the system for my needs is still fast enough. Though on occasion when for example opening up meecast (which is the longest running app and not so often used) I can see how it is pulling it from swap as it lags slightly to show up. But this is very subtle. (You really need to focus to even see this)
A more sane value to first test with I guess would be 75 % or even 60 %.
To do this open up the terminal and devel-su You can change the value directly (for testing purposes) by entering
echo 75 > /proc/sys/vm/overcommit_ratio
Replace the 75 with the value you want to test.
I hope this thread can start a good discussion about a healthy new default value so that frequent OOMKillings can be stopped in a quick fix for update 10 or update 11.
'75' works reasonably well for me, no glitches/killed applications so far.
rod ( 2014-12-25 20:30:18 +0200 )editThanks for this discussion. The overly agressive app killing is very troublesome for me. Testing 75 now.
salyavin ( 2014-12-25 23:57:06 +0200 )editI suggest having an option in sailfish utilities or control panel where you can adjust a slider bar to control the aggressiveness of OOM behaviour. or some options like
makes sense?
droll ( 2014-12-26 09:03:46 +0200 )editTesting with 75 and first tests look very promising. Thank you for sharing this.
rooster13 ( 2014-12-29 10:20:21 +0200 )editAfter last sys update (1.1.1.27) I have problem with TeamViewer app when it almost establish connection, app just crashed every time.. Don't know what to do, and it worked perfectly before sys update... Tried your tip and changed to 70 and 90, but app continue crashing... Is it necessary to reboot/shutdown/refresh homescreen after changing ?
Schturman ( 2015-01-06 11:55:56 +0200 )edit