We REALLY have to extend the zram to get more RAM!!! A REVOLUTION I WAS WAITING FOR THE LIBREM 5!
After many tests, i could open:
- 25 apps, opened quickly one after the other, including:
- Heavy apps: Firefox, VPN, Waydroid, Freetube and whatch a video,
- System resources
- Dino
- Terminal
- and others
- can do what i want
- wifi on, charging the phone
About 2 hours of continous testing
CPU: 90-100% during a lot of time, and back to 40-50% afterwards
Total MEMORY usage: 7-8 GB !!!
GPU at 48°C, stable.
The limit seems to be above 8 GB of total used memory + heavy CPU task. I opened ALL my apps (and they all opened a window) and after some minutes, the system lagged strong and got frozen. I could not really get above 9GB of used memory.
With standard usage (Terminal, Settings, Surfshark VPN, Dino, Firefox (editing posts), Secrets, Telegram, Waydroid (still fluid, with Conversation, Telegram), Freetube (watching a video), Maps). It stays fully fluid. Temp is 45°C, Memory at 6-7GB. It is a dream.
==> Little lags sometimes, NO FREEZE, NO CRASH, has always time to close apps if it gets lagging too much,). IT IS A REVOLUTION!
In the past, after opening 4-5 apps (firefox, waydroid, dino, freetube, vpn), I got system crash (frozen screen, and heavy hot phone) after some minutes, making for me waiting for updates or limited usage that would make the phone daily usable for me. With this setting, if it gets lazy, lagging, i always have time to close some apps and continue my work.
Amazing!
Look at the swap: 13.3GB!
What i did is: set zram at 13.3 GB with zram-fraction=4.5 (6 works also) and no limit of max size (see below) just to see what happens.
Here are two ways to do it simply:
- Preferred way
Source How to resize ZRAM (compressed swap) managed by systemd/zram-generator | Ctrl blog
- Copy this script in a file your_script_path
#!/bin/sh
sudo tee /usr/lib/systemd/zram-generator.conf.d/librem5.conf <<EOT
[zram0]
zram-fraction = 2
max-zram-size = none
EOT
sudo systemctl restart systemd-zram-setup@zram0
- Alternative way (you don’t need both!)
- your_script_path can also contain:
#!/bin/sh
sudo swapoff /dev/zram0
sudo zramctl --reset /dev/zram0
sudo zramctl --find --size 5G
sudo mkswap /dev/zram0
sudo swapon /dev/zram0
sudo systemctl restart systemd-zram-setup@zram0
- Finish
- Run the script
sudo bash your_script_path
- check
swapon
NB1:# zram-fraction = 2 (zram0=5-6GB) is enough. More is ok but brings nothing. The cpu is then the limit.
zram-fraction accepts decimal number, and seems unlimited (i tried 6 with no problems)
NB2: If you get trouble after restarting the service, reboot the device and run the script again immediately after login. If you have to much autostarting apps, they can busy the zram, making it not usable by restarting the systemd service, so disable them before reboot.
- In order to make this persistent in case a system update overrides the changes made by the script,
So, to make it persistent, even after system update:
- create a service “at boot”, with this script (just complete ExecStart):
#!/bin/sh
serviceName=run_at_boot
sudo tee /etc/systemd/system/$serviceName.service > /dev/null <<EOT
[Unit]
Description=run_at_boot
[Service]
ExecStart=your_script_path_in_absolute_path
[Install]
WantedBy=multi-user.target
EOT
chmod +x your_script_path_in_absolute_path
sudo systemctl enable $serviceName
sudo systemctl status $serviceName
- run it
sudo your_script_path_in_absolute_path
PS: I am also using such a service to autobackup the system at boot on my sdcard and autowakeup from suspend to fetch my xmpp messages.
Enjoy!
It is now in the wiki: Tips & Tricks · Wiki · Librem5 / Librem 5 Community Wiki · GitLab