We have moved to a new Sailfish OS Forum. Please start new discussions there.

[Suggestion] ZRAM + swappiness tweaks -> more performance [released]

asked 2014-06-09 18:14:21 +0300

leszek gravatar image

updated 2014-06-09 18:31:57 +0300

nodevel gravatar image

As Jollas CPU is powerful enough getting rid of the slower swap partition and using the faster zram might help when ram is running full. When using zram it also makes sense to change swappiness to swap things out early (as this leaves more free memory for current tasks and apps and new apps)

So my suggestion recompile kernel with zram enabled and change vm.swappiness to 100. Get rid of swap partition if possible (should be no problem as swap is only 500 MB now and zram can without any problem use 1/2 of the ram for compressed swap)

edit retag flag offensive reopen delete

The question has been closed for the following reason "released in a software update" by simo
close date 2014-12-20 12:46:06.056442



I got a battery drain with zram. 100 % charge after 3.5 hours usage gets to 60% with zram!

Kollin ( 2014-09-11 20:20:11 +0300 )edit

ZRAM uses the cpu when swapping out to compress stuff. Normally the cpu should not have problems compressing stuff. Did you use the phone extensively ? Did you check if swap was even used ?

leszek ( 2014-09-11 21:09:08 +0300 )edit

It's my second day of usage and I haven't seen any battery drain. Jolla lasted on battery as usual about 12 hours but I must admit that I changed the stock values in zram config files. Instead of stock 25% of ram allocated to zram I use 43%. It's stable and what's most important to me faster than originaly used swap partion. One little thing I'd like to add is to make proper use of zram you have to also disable default swap in terminal or reenabling it with lower priority. Other way jolla won't use zram till the swap's filled up.

Mądry ( 2014-09-11 22:21:50 +0300 )edit

Hi there, I'm the guy who compiled and packaged zram (and zramcfg) :)

zramcfg automatically sets the swap priority value of the zram devices at 32767, which is the maximum. Theoretically the kernel should already prefer the zram devices to the normal swap partition.

I can't talk about the battery life because here is the same (which can be better...) with or without zram.

Anyways, thanks for the feedback, I hope that this community testing can be useful in future if Jolla wants to enable zram by default (which IMHO is not a bad idea at all, but the I agree that the version in Linux 3.4 is pretty outdated...)


g7 ( 2014-09-11 22:58:08 +0300 )edit

I think that my battery drain was something like "first time use" problem: Installed zram, rebooted and the charge dropped instantly from 90% to 20%.I did charge the phone, after that discharge was like i described it above (3.5 hours = 40% drain), 24 hours later everything seems normal. Can you tell me please how to disable swap permanently!!!!?

Kollin ( 2014-09-12 08:27:40 +0300 )edit

2 Answers

Sort by » oldest newest most voted

answered 2014-09-10 21:03:08 +0300

DeeGee gravatar image

zram is now on openrepos and at least it didn't crash&burn on my device. But haven't yet tested it very extensively. https://openrepos.net/content/eugenio/zramcfg-configure-zram

edit flag offensive delete publish link more

answered 2014-11-06 15:35:50 +0300

nthn gravatar image

ZRAM is planned to be enabled in update10: https://lists.sailfishos.org/pipermail/devel/2014-November/005168.html

edit flag offensive delete publish link more


Awesome - Great news!

forgrimm ( 2014-11-06 15:54:06 +0300 )edit

Question tools



Asked: 2014-06-09 18:14:21 +0300

Seen: 12,505 times

Last updated: Nov 06 '14