maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [SFOS][1.1.0.27][OOM] The death of multitasking? (https://talk.maemo.org/showthread.php?t=94358)

korppi 2014-12-26 18:06

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Ok now I have better solution for you to try.

There is no out of memory condition. But low memory killer is way too aggressive. Phone doesn't even swap when it starts to kill apps.

I have 17 apps running. Including 4 different browsers with page open. After these tweaks no OOMs or lowmemory kills yet.

This is what I did:

echo "80" > /proc/sys/vm/swappiness

echo "32 24" > /proc/sys/vm/lowmem_reserve_ratio

echo "100" > /proc/sys/vm/percpu_pagelist_fraction

echo "98304" > /proc/sys/vm/extra_free_kbytes

m4r0v3r 2014-12-26 18:06

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
btw, for people that dont care about Android that much, or want to limit the trouble maker, under /opt/alien/system is a build.prop file where you can mess with the heap size to your hearts content,

Quote:

Originally Posted by pichlo (Post 1453974)
More RAM??? Whatever the hell for!? My main PC, running Debian Wheezy, 1 GB RAM and no swap, idle with just the OS, background processes and SysMon running, uses 140 MB RAM. My Jolla, allegedly optimised for running on low resources, uses 420 MB in the same configuration. HOW COME???

It's not more RAM we need. It's less bloat.

I honestly don't know where this overhead is coming from? Is it Qt 5.2? I used to have issues with lag at times, but nothing to serious the device would stop functioning. It seems the browser is a huge culprit. Hmmm I wonder is it time to try and revive firefox builds for Qt

synt 2014-12-26 18:38

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
This morning I started up 9 apps (Browser, meecast, 2 Android IM apps, Gmaps etc.) and have been using and switching between them all day. Not one of them has closed by itself and the phone is mostly as smooth as with fewer apps. The only tweak I've made is to increase vm.swappiness to 60 in /etc/sysctl.d/vm.conf file.

So as of now I'm very happy with the performance and behaviour! There must be something that is different between users since I've never had Jolla to run so great and others are declaring the death of multitasking :confused:

salyavin 2014-12-26 19:46

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
For me tweetian, gpodder, tt-rss alone would sometimes close stuff, if I open a browser for articles from tt-rss it would sometimes close all apps. overcommit helped some trying swappiness and some others now. Why can't we match the N900?

willi6868 2014-12-26 20:52

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by synt (Post 1453998)
The only tweak I've made is to increase vm.swappiness to 60 in /etc/sysctl.d/vm.conf file.

A Jolla sailor provided here on TJC some tweaked values to reduce UI lags (with update 9) and he additionally also tweaked some other values in /etc/sysctl.d/vm.conf.

So where is the difference between tweaking /etc/sysctl.d/vm.conf and /proc/sys/vm/ and what is better? :)

salyavin 2014-12-26 21:20

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
changing vm.conf is persistent across reboots. /proc/sys/vm is set by that script.
setting /proc/sys/vm directly affects this boot but if you reboot it will revert. You have to put your changes in a startup script if you want them to persist.

llelectronics 2014-12-26 21:38

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by willi6868 (Post 1454021)
A Jolla sailor provided here on TJC some tweaked values to reduce UI lags (with update 9) and he additionally also tweaked some other values in /etc/sysctl.d/vm.conf.

Most of those settings except the swappiness are now the default on update 10.

Manatus 2014-12-26 23:18

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by MartinK (Post 1453957)
Well, you did not really get it back - you lost up to 200 MB. Zram kicks in before the real swap starts to be used and can usually achieve an up to 50% compression ratio. So a 100 MB zram volume can give you up to 200 MB in-RAM space - basically an extra 100 MB of still fast RAM.

Actually I wonder if that new fancy OOM killer actually takes zram properly into account, as using it should not lead to any noticeable slowdowns. If would be very very wrong if it just lumps it together with normal swap when calculating if it should kill something.

Also, the zram volume size (actually 2x50 MB so that both CPU cores can be used for compression) seems kinda small compared to overall ram size - it is usually advised to use a much bigger amount of ram for zram. Even the N9 that also had just 1 GB of RAM used 256 MB for zram (still called compcache back then - see these nice slides about compcache usage on the N9 and N900).

So I would advice trying to make the overall zram volume size larger to see if it helps with the OOM situation. :)

Yes, I know. I lost mem but I suspect that OOM is not just linear and total memory dependant. Just testing different things... For now it seems to work quite well. :)

Zeta 2014-12-26 23:36

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Dammit, it even killed the music player while playing !

Sailors, enjoy your holidays, because you have some serious work to do on this when back in January ! ;)

salyavin 2014-12-27 00:11

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Yes it kills music players while playing or gpodder. I don't feel that they have that much work to do, it's probably just settings that need to be discussed. I had a lot of improvement raising overcommit and swappiness. For those who don't feel comfortable messing with startup scripts to make settings persistent not sure what should be done, Jolla release something seems the best otherwise something in openrepos. A lot of discussion can be done on what the "correct" settings should be. korppi has some interesting ideas above.

m4r0v3r 2014-12-27 00:51

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
they can put this stuff in the utilities section in the settings

salyavin 2014-12-27 01:34

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Yea I think that's a good place for it.

messing with settings described in this thread seems to have totally fixed it for me. Have gpodder, tweetian, tt-rss, android weechat, meecast, and I can launch the browser from tt-rss to read a full article and I have no issues at all, nothing is killed.

willi6868 2014-12-27 11:59

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by synt (Post 1453998)
The only tweak I've made is to increase vm.swappiness to 60 in /etc/sysctl.d/vm.conf file.

I also tweaked this value now and it seems to work quite well till now.

BTW if someone doesn't follow the TJC thread - a Jolla employee just posted an comment:

Quote:

Originally Posted by tigeli
Ok, in short... you can play with these:
  • /sys/module/lowmemorykiller/parameters/adj (0,58,117,529,1000)
  • /sys/module/lowmemorykiller/parameters/minfree (4096,6144,8192,12288,20000)
  • /proc/sys/vm/extra_free_kbytes (16384)

First sets oom_score-values for group of apps running inside of those values, second sets the values how much memory should be always available before killing apps in that group starts. Third sets the value of how much memory should always kept free.

Example.. apps having oom_score between 0 and 57 will not be killed before the memory has gone below 40964 = 16384kB. Apps having oom_score 1000 will be killed if there is less than 200004 = 80000kB available memory.

Maybe someone could provide some nice values for fine tuning. :)

nthn 2014-12-27 12:55

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
If you want something added to the Utilities to change OOM stuff: https://github.com/sailfishos/sailfish-utilities

catbus 2014-12-27 14:24

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
^nothing _new_ ...

salyavin 2014-12-29 02:11

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Had one app close today and gave up and did
"echo "0,0,0,0,0" > /sys/module/lowmemorykiller/parameters/minfree"
from https://together.jolla.com/question/...#comment-73891

w00t 2014-12-29 02:58

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by ste-phan (Post 1453928)
So there seems to be a major change with regard to Android programs. I thought previously, Android Myriad Dalvik just had 512MB RAM at max and the rest would remain reserved for Jolla?

There's been a lot of changes. One of them is that Android is now subject to the same behaviour as the rest of the device, whereas previously, Android was allowed to kill off everything else and swap the device into oblivion (or reboot), which serves to make the behavior a bit more visible for people who use a lot of Android applications.

w00t 2014-12-29 03:09

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by m4r0v3r (Post 1453995)
I used to have issues with lag at times, but nothing to serious the device would stop functioning.

The problem is that everyone is not you. Different people use their devices in different ways, run different software, emphasize different features.

One favorite bug as an example for this that I helped fix a few months ago was a SQL query in Messages taking well over a second for someone (freezing the UI the whole time), whereas for me it didn't even take more than 20ms. Something on his device was clearly off. I never really looked into that part, rather hard to do remotely, but I did fix the query: https://github.com/nemomobile/libcom...a02b61a74a3192

szopin 2015-07-14 01:50

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by salyavin (Post 1454229)
Had one app close today and gave up and did
"echo "0,0,0,0,0" > /sys/module/lowmemorykiller/parameters/minfree"
from https://together.jolla.com/question/...#comment-73891

Has anyone figured out how to properly kill/disable lowmemorykiller? Neither tweaking overcommit_ratio, nor this minfree trick stops the lowmemorykiller from killing cc1plus when compiling on device.

Ok, from my testing this seems to kill oom-killer for good:
Code:

echo '9999' > /sys/module/lowmemorykiller/parameters/adj
echo '1' > /sys/module/lowmemorykiller/parameters/minfree

your process will die if it eats all swap+ram, but other apps stay alive
thanks to nieldk

dameceno 2017-03-20 11:31

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by szopin (Post 1476562)
Has anyone figured out how to properly kill/disable lowmemorykiller? Neither tweaking overcommit_ratio, nor this minfree trick stops the lowmemorykiller from killing cc1plus when compiling on device.

Ok, from my testing this seems to kill oom-killer for good:
Code:

echo '9999' > /sys/module/lowmemorykiller/parameters/adj
echo '1' > /sys/module/lowmemorykiller/parameters/minfree

your process will die if it eats all swap+ram, but other apps stay alive
thanks to nieldk

This commands might have worked previously but on 2.0.5.6 I still get apps being killed and some lagging behavior at times.
What are the commands to revert this please?

mscion 2017-03-20 18:27

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
I think the premiss of this thread is dead wrong. In order to multi-task you just need to own multiple devices...

pichlo 2017-03-20 20:14

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by mscion (Post 1525722)
In order to multi-task you just need to own multiple devices...

No.
10 chars

mscion 2017-03-20 20:22

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by pichlo (Post 1525728)
No.
10 chars

Sometimes?

pichlo 2017-03-20 20:28

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Yeah, OK. To check your Facebook whilst driving you need a smartphone AND a car.

mscion 2017-03-20 20:42

Re: [SFOS][1.1.0.27][OOM] The death of multitasking?
 
Quote:

Originally Posted by pichlo (Post 1525731)
Yeah, OK. To check your Facebook whilst driving you need a smartphone AND a car.

Ha Ha! Good point. A smartphone and a smartcar!
Actually, I've noticed that multitasking has improved somewhat on Android. My apps do not randomly die when put in background. Of course my phone has 6GB ram!


All times are GMT. The time now is 12:49.

vBulletin® Version 3.8.8