Questions tagged [zram]
35 questions
18
votes
3 answers
What is the appropriate value of vm.swappiness when using zram?
I'm using zram on my computer as a compressed RAM-backed swap. When the system needs to swap something out, swapping it to a zram-backed swap file is more or less equivalent to compressing that data in-memory to free up space. This makes swapping…
Ryan C. Thompson
- 5,398
- 6
- 29
- 23
12
votes
2 answers
What is an alternative for zcache?
I want to use a high-speed swap device or zram as "page cache", so that page data can be dropped automatically when the system is out of memory.
Apparently, zcache has been discontinued. Is there an available alternative? If yes, which one?
bcache…
illiterate
- 361
- 3
- 13
12
votes
5 answers
How to set up properly zram and swap
I'm configuring & compiling new 3.0 kernel. One of the goodies I planned to use for some time (by patching) that was merged into 3.0 is zram.
Is it possible to set both hdd swap and zram swap so the zram is used first and only spilled pages are put…
Maciej Piechotka
- 16,578
- 11
- 57
- 93
9
votes
2 answers
Cleancache vs zram?
I have an old laptop here with only 512 MB of RAM. Since a few kernel releases, I am using zram to convert 256 MB of it to a compressed ramdisk which is then used as swap. This has proved to be very successful and the system is much more responsive,…
lytenyn
- 303
- 2
- 9
8
votes
1 answer
Prevent zram LRU inversion with zswap and max_pool_percent = 100
The major disadvantage of using zram is LRU inversion:
older pages get into the higher-priority zram and quickly fill it, while newer pages are swapped in and out of the slower [...] swap
The zswap documentation says that zswap does not suffer…
Tom Hale
- 28,728
- 32
- 139
- 229
7
votes
1 answer
Make or force tmpfs to swap before the file cache
Consider the following scenario. You have a slow read-only media (e.g. write-protected Thumb Drive, CD/DVD, whatever) that you installed Linux on (not a Live CD per se, but a normal build), and use it on a computer with literally no other forms of…
kktsuri
- 195
- 1
- 7
6
votes
2 answers
How do I determine ZCACHE works on my box?
I have an Marwell Kirkwood ARM-based NAS server Zyxel NSA 310. I compiled my own 3.8 kernel and enabled ZCACHE, but I still see 256 MB of RAM. I am not sure if GNU free utility should show extra amount of RAM. How do I find out it is really working?…
lzap
- 2,032
- 2
- 14
- 13
4
votes
1 answer
Why does zram occupy much more memory compared to its "compressed" value?
I set up zram and made extensive tests inside my Linux machines to measure that it really helps in my scenario. However, I'm very confused that zram seems to use up memory of the whole uncompressed data size. When I type in "zramctl" I see…
Testerhood
- 289
- 2
- 9
4
votes
1 answer
How to fix zramswap error?
I installed zramswap-enabler on Ubuntu 11.10 using the ppa but when installing programs or running system upgrades I get this error:
Setting up zramswap-enabler (0.2.1-0~12~oneiric1) ...
start: Job failed to start
invoke-rc.d: initscript zramswap,…
tinuz
- 41
- 2
4
votes
0 answers
How much RAM is there?
I'm trying to estimate how effective the zram kernel module is in case of my PC. I have a pretty old machine (7y) with the only 1 GiB of RAM.
I created two zram swaps (two core processor), 250MiB each, and everything seems to be working:
# swapon…
Mikhail Morfikov
- 10,309
- 19
- 69
- 104
3
votes
3 answers
Does swap on zram free backing pages when pages are unswapped from it?
Imagine a scenario where 2GiB is swapped out to zram and compresses down to 1GiB.
Once the memory pressure is alleviated and the 2GiB gradually become unswapped, does Linux free the 1GiB of pages that were used to store the compressed zram pages?
If…
Atemu
- 584
- 4
- 14
3
votes
0 answers
How much percentage should zram take?
I'm setting up zram on my server, let's say I have 4GB ram, should zram take 3.5G or 1G or something in between? What trade off will I have when going to the extremes?
And, for example I have a single thread that's taking 30mb of ram in zram, when…
Pegasis
- 131
- 2
3
votes
1 answer
Using loopdev for zRAM writeback feature
Documentation states that zRAM writeback feature supports only swap partitions as it's backing_dev. But I've successfully used a swap file too, by attaching it to a loop device
losetup /dev/loop0 /swapfile
cd /sys/block/zram0
echo /dev/loop0 >…
Роман Мавроян
- 767
- 9
- 17
3
votes
0 answers
zram swap instability
I use Mint 13 Maya with mainline kernel 3.6.3 for Ubuntu Quantal on my Asus P53E Notebook.
I use zram swap that comes with the package zram-config.
I've noticed that using it the system to hangs at random moments, especially (but not always) under…
Adam Ryczkowski
- 5,493
- 7
- 39
- 60
3
votes
1 answer
Is zstd for zram actually available in Linux 4.15?
I found zstd in /drivers/block/zram/zcomp.c, but I can't find anything zstd-related in /crypto.
So is zstd for zram actually available in Linux 4.15 or not?
illiterate
- 953
- 7
- 22