Set up zram to help Uitukka/Vaarainjarvi memory pressures [released]
asked 2014-10-29 07:30:55 +0200
This post is a wiki. Anyone with karma >75 is welcome to improve it.
Update 9 Uitukka seems to bring along memory pressures for ~tiny~ 1 GB RAM available. Tiny in that sense that Jolla has dual systems in place, modern Android devices have 2..3 GB of memory just for Android, but Jolla try to support both Android and Sailfish by only 1 GB.
New QT framework version 5.2 plus another more modern components of system SW like browser engine updated to Gecko 31 seems to give Jolla's RAM memory hard times. Sometimes (after update9) with many apps open Jolla feels little bit laggy like N900 which is notorious with constant swapping no matter what you try to do putting phone to lagging.
That might help partly if Jolla enables zram (linux kernel module offering compressed RAM cache) to make part of system memory compressed. By utilizing zram, device can hold more active content on RAM before swapping pages out to slow internal flash.
At least recent Android versions use zram as basic feature, so it should be well behaving linux kernel component to help Jolla out of OOM (pun intented).
EDIT1. There are zram module available in Openrepos (thanks @g7), it is unfortunately not compactible with Uitukka (see comments below).
EDIT2: I just noticed that this thread is actually at least half duplicate of zram swappiness tweaks..., but still I think that this is relevant to bring up in context of Uitukka issues with OOM.
EDIT3: I get hit by classic browser bug (clicks get registered in wrong place) making this thread unintentionally wiki ... There are no function for user to convert this back to question, I suppose.
EDIT4. So, I got what I deserved in this case - Now, as Wiki entry I add reference to another suggestion to improve and balance memory managenent to do whatever it can to keep Jolla sailing smoothly. This thread vm.swappiness discuss deeply of pros and cons of the set up swap management parameters.
EDIT5. Now, we have got in our hands update 10, which, indeed, has enabled zram as a base system feartue. What I have missed so far is the information if zram is enabled automatically for those that has not set it up already before upd10. I upgraded name of this thread accordingly.
EDIT. Yes, zram is active for all u10 users. Here are information how to change the zram size from default 13%: https://together.jolla.com/question/77183/how-to-change-zram-size/
I still wonder what is the best size for zram to prevent too aggressive low memory killer to kick in and start killiing (randomly, not so, but it still feels like it) of tasks?
I really do not like to loose my tasks regulary, I have even started to envy iOS approarch at least save the state of task before killing it to be able to restore it at least seemingly same state...
There were some people that were testing it at some point and there is a package on openrepos. No idea how well it works.
ApB ( 2014-10-29 08:25:02 +0200 )editI have that Openrepos zram module activated before update to Uitukka. Openrepos zram work just fine, I have zero problems with that.
The kernel version of Uitukka is newer than Tahkalampi, so I removed zram before applying the update. I think that developer (eugenio) need to compile zram module again against Uitukka kernel to get that work.
I have not dared to install zram back to system updated to Uitukka before dev announces that openrepo version is compactible with Update9.
Of course, this is so deep integrated system feature that it really should come directly from Jolla so they can tune zram and hole system memory policy etc. parameters to fit together.
pata ( 2014-10-29 08:34:28 +0200 )edit(I'm the zram maintainer on openrepos)
I'm waiting for the Uitukka kernel sources to be available so that I can recompile the module against the new kernel.
Stskeeps said that the module may ship by default in one of the upcoming updates, though it's not guaranteed it will be enabled by default. That would as well ease things for me because I only need to keep around the configuration package (zramcfg).
Unfortunately the "ancient" kernel version of the Jolla makes enabling zram not a trivial task. There are a few patches that need to be applied because the zram module in 3.4 does not support ARM by default. More patches means more testing that needs to be done.
g7 ( 2014-10-29 09:51:30 +0200 )editLike @pata I have the zram module activated on 1.08, as well as the gpu idle state module. Without them I find Sailfish pretty laggy and unsuitable for having multiple apps or tabs in browsers open. with, it's usable, though still not ideal. since 1.1 and the new Qt framework seem to be a lot more resource hungry, I think I'll be waiting until both are updated in Warehouse. Thanks @g7 for your work ... has made Sailfish much less frustrating to use for me.
midnightoil ( 2014-10-29 09:56:20 +0200 )editI think it's a complete duplicate and it would be better to have 60 votes on the original one than 30 votes on each. (Destiny has chosen to make your question a Wiki so you would not earn karma with a duplicate :P)
Sthocs ( 2014-10-30 23:46:51 +0200 )edit