Why and how to extend ZRAM on L5. A revolution for Librem 5 stability!

Well seen!. It is also why i converted my instructions in my original post, to avoid typing mistakes.

3 Likes

@irvinewade @Lionel Really thank you so much for your lasts posts!! It’s working perfectly now!! Just last question to understand: why I see Lionel’s zram swap13.3GB in the first post? I just have 5.3 that’s ok for me! But how to reach that number? I also tried setting zram-fraction=4 but it remained 5.3! Maybe it dinamically increase to 13.3 when zram reach 5.3?
Anyway zram-fraction is set on 2, now, as suggested! And L5 temperatures are ok now!
Thank you
:pray::grinning:

3 Likes

Great !
13.3 GB with fraction = 4.5 (It is all explained in my original post). It was just a test for me to see if it did a problem (freeze or crash) with all apss opened.
I estimate it not useful to have zram above 5.5 GB, but make it if you think you need it.
Do you really see a difference with temperature?? I was not sure about my feeling and as i remember, i did some of the tests on the floor which was then cooling the phone.

2 Likes

Yes! I opened all apps installed, including Waydroid and all temperatures were below 50 degrees (around 47/48). Before zram, as explained in another thread, my L5 reached 60 degrees!!! It was so hot that I had problem to keep it in my hand!

4 Likes

Great to confirm my experience! Thank you for your perseverance in trying this trick.

4 Likes

I saw mention of PR for this. Anyone have an idea when it might get into “production”?

Trying to decide if I should try it now or just wait (uncertain whether it would conflict with doing it manually ahead of time in some way).

1 Like

Just wanted to say thanks, this did miracle on my librem5

3 Likes

What do I do for the path portions?

1 Like

also, journal error ocurred for restart systemd-zram-setup@zram0

1 Like

Couldn’t restart service, but after reboot, my setup was set properly. 6.1G of ZRAM

1 Like

You have to do the changes just after booting, because if the zram gets used too much from the system it blocks the service’s restart.

2 Likes

tried this on pmos for my librem 5 because pureos mobile data handoff bug still exists. I have to follow the link beblow since there is no systemd. Is this a correct way to extend zram by editing zram.init?

https://wiki.alpinelinux.org/wiki/Zram

1 Like

Can there be any issue if i have already extended the swap file to 3.5 gb and also extend zram ?

1 Like

I don’t think so. I did many different tries with different config before I write this post.

1 Like

I just run the script. You were right ! Amazing boost in performance compared with only swap file. Even scrolling feels blazing fast .Now i have 8,2 Gb. I guess its the total of the extended swap and the 5 gb of zram. Can this cause any issue because of the extra swap ? Have you noticed any downsides such as more battery drain ?

2 Likes

6.1GB does fine on my end.

2 Likes

Any increase in battery drain ?

1 Like

For me, switch swap file 2g and zram 4g the phone is still laggy.

1 Like

Today I got zram service to start error message while running the script

1 Like

FWIW you may want to remove this kind of scripts from your phones to not conflict with configuration that’s coming in librem5-base-defaults 66pureos1~byz3 (or 68pureos1 in crimson).

5 Likes