WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: zswap-vs-zram-when-to-use-what  (Read 2407 times)

Offline nick65go

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1039
zswap-vs-zram-when-to-use-what
« on: April 16, 2026, 07:22:03 AM »
main article here : https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html

and some user summary here:
https://www.phoronix.com/forums/forum/software/distributions/1624087-kde-linux-hardening-their-os-against-updates-making-systems-unbootable#post1625266
" Here's a TL;DR (my understanding):
zswap is preferable in almost every situation. ZRAM only somewhat works in specific cases, like embedded or Android. For ZRAM to work, you must NOT have a disk swap, and need a usespace OOM killer, otherwise, you'll have very bad time when it starts to fill. Fedora and Android, notably, use ZRAM, because they made the decision to completely eliminate disk swap, which meant that zswap just was not an option, so they made sure to minimize the issues that come with ZRAM (read the blog for details). With that said,zswap is said to be receiving a disk-free mode down the line, making ZRAM completely obsolete, and so it's receiving less and less support.

In conclusion, zswap is a MUCH safer, and often better (performance and stability) option, but if you have specific constraints (completely avoiding swap), you can use ZRAM on desktop, but must be extremely careful, and even that only untill zsawp gets the feature to work without disk swap itself."




Offline neonix

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 634
Re: zswap-vs-zram-when-to-use-what
« Reply #1 on: November 08, 2026, 05:24:25 AM »
According to this article
https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html
Fedora use all RAM that is in the system. I use this strategy and set more RAM than tinycore allocate during boot. Effect is better that standard. I don't think I can double RAM space, but I can delay moment when kernel start to kill programs.
 
Quote
tce-load -i util-linux
sudo swapoff /dev/zram0
sudo zramctl --reset /dev/zram0
sudo zramctl --find --size 2G
sudo mkswap /dev/zram0
sudo swapon /dev/zram0

According to this article you can even create ext2 compressed ramdisk.
https://karelzak.blogspot.com/2014/08/zramctl.html

Implementation of zram in TinyCoreLinux is very bad in my opinion, we can achieve better results if we experiment with differen configuration options.

Offline nick65go

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1039
Re: zswap-vs-zram-when-to-use-what
« Reply #2 on: November 08, 2026, 12:24:58 PM »
Implementation of zram in TinyCoreLinux is very bad in my opinion, we can achieve better results if we experiment with differen configuration options.
For CachyOS (arch x86_64-v3) for my 32 GB RAM, by default is full RAM as ZRAM.
I would be more careful with final/strong conclusions in TinyCore.
It depends on which people/hardware TC is addressing. A question I asked long time ago but was not answered by TC developers/users, even today. Like CPU/RAM/HDD specs on average.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1646
Re: zswap-vs-zram-when-to-use-what
« Reply #3 on: November 09, 2026, 02:39:17 PM »
Just curious what are they using for a userspace OOM.

I did a little test, and tried earlyoom for userspace daemon, and it failed miserably at catching a test  (tail /dev/zero)   It showed ram and zswap getting filled up, and tried to kill about everything except what was consuming of the ram.....never did kill that process until thinks locked up.

oomd is probably the next to test.

Offline neonix

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 634
Re: zswap-vs-zram-when-to-use-what
« Reply #4 on: Today at 10:26:40 AM »
For CachyOS (arch x86_64-v3) for my 32 GB RAM, by default is full RAM as ZRAM.
I would be more careful with final/strong conclusions in TinyCore.
It depends on which people/hardware TC is addressing. A question I asked long time ago but was not answered by TC developers/users, even today. Like CPU/RAM/HDD specs on average.
[/quote]
Tiny Core is addressed mostly for people with x86_32 architecture computers from 486DX to 686. Minimal RAM is 64 MB, maximum is 4 GB. There's no HDD. To install modern web browser you need 1 GB pen-drive.

Average is 586 with 2 GB RAM and 512 MB pen-drive.  8)

Offline nick65go

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1039
Re: zswap-vs-zram-when-to-use-what
« Reply #5 on: Today at 10:52:39 AM »
Tiny Core is addressed mostly for people with x86_32 architecture computers from 486DX to 686. Minimal RAM is 64 MB, maximum is 4 GB. There's no HDD. To install modern web browser you need 1 GB pen-drive.
Average is 586 with 2 GB RAM and 512 MB pen-drive.
IF you are right about it, then I believe your quote should be put in a frame at start of Tiny-core web-site!
I think this is very important notice for future visitors in the age of UEFI, arch 64 bits, kernel version max 6.18.60, etc.
To do not mislead users like me, which are spoiled with extra resources; so clone of mine will not struggle if is not need.
Oh, now I can sleep better, because I do not need to learn about TC which will show minimal improvements for my hardware  ;)