Questions tagged [zram]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
98 views

Arch: Recreate Swap Partition?

I'm running arch, installed with archinstall. I read that arch uses zram for swapping, not disk. Also read somewhere that zram doesn't use disk for swap, so i don't need a swap partition. (I don't get ...
johny why's user avatar
  • 361
0 votes
0 answers
57 views

Selectively exclude paths or filesystems from Linux disk read cache

The Linux kernel uses unused RAM for disk read caching. This is generally a good idea. But is there a mechanism to selectively exclude certain paths or mounted filesystems from this cache? ZFS for ...
1N4001's user avatar
  • 351
0 votes
1 answer
1k views

PopOS 22.04 - Swappiness ZRAM value, size

How to change the "zram" size in PopOS 22.04? I did not create a ram partition, I was automatically added zram, which is 16.6 gb. It has a swappiness of 180, I want to change it to swappines ...
virtual_robot's user avatar
1 vote
1 answer
200 views

Any way to create zram disk (not swap) during boot time except via script?

https://askubuntu.com/questions/130374/ramdisk-compressed-writeable-no-swap Gives script to make zram disk (load module, set parameter, format block device, mount). Is there any way to have same ...
Alex Martian's user avatar
1 vote
0 answers
119 views

initramfs on zram

I use a minimal initramfs as my root filesystem which I load from the network. Since the initramfs is just there to get the system started (and I have no other rootfs) I'd like it to take up as little ...
Fallen's user avatar
  • 151
0 votes
1 answer
394 views

Can't mount zram device on /tmp (Booting problem)

I have a simple script that creates a zram device and formats it to ext4 and finally, it mounts zram on /tmp. #!/bin/bash # create zram with size 1.5G # $zram_dev is created device path (eg. /dev/...
linux user's user avatar
0 votes
0 answers
88 views

How to limit swap usage without using sysctl or resizing the partition?

There is the following scenario: I have an HDD disk that uses LVM and I cannot resize the partitions in it, in this disk, there is a swap partition that is 10gb. I also use zram apart from disk based ...
Overclocked Skid's user avatar
3 votes
3 answers
1k views

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 ...
Atemu's user avatar
  • 648
0 votes
1 answer
604 views

My RAM usage never goes over 75% when system is lagging and under heavy load

Linux matrix 5.15.2-xanmod1-1 #1 SMP Wed, 17 Nov 2021 02:36:25 +0000 x86_64 GNU/Linux NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS sda ...
Dominic's user avatar
  • 139
1 vote
1 answer
509 views

Explain Zram and Swap numbers

Ok, so there are really 2 questions here, why is my on disk swap being used? Is the compression of my swap really this good? It seems pretty unlikely, but it's also possible it is because it's memory ...
xenoterracide's user avatar
3 votes
0 answers
458 views

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 ...
Pegasis's user avatar
  • 131
1 vote
1 answer
852 views

zramswapon failed: Operation not permitted

When I try to enable the zram service on a machine with 32 cores, it fails when the number of devices is greater than 26. Also, I do not see any configuration file, only zramctl utility with no ...
nskalis's user avatar
  • 13
2 votes
0 answers
135 views

"Preempting" less-used pages in high priority swap to lower priority swap

Let's say I've got two swap partitions on my Linux machine. One is zram and a higher priority. The other is on disk and a lower priority. I prefer the zram swap because it's faster. As I understand it,...
2rs2ts's user avatar
  • 153
0 votes
2 answers
665 views

How to Enable ZRAM on PC?

I am trying to know how to enable ZRAM for my PC running Ubuntu. I have heard that the ZRAM is speeding up some laptop and PCs, so will the ZRAM help My PC too? PC specs: CPU: Intel Core 2 Duo E4500 (...
Русев Путин's user avatar
4 votes
1 answer
8k views

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 ...
Testerhood's user avatar
2 votes
1 answer
335 views

Get % used of zram in script

I've got a script that collects various bits of system data and reports this via MQTT to a central local server. I recently implemented zram with priority over swap to see if this offers a performance ...
Phill Healey's user avatar
3 votes
1 answer
1k views

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 /...
Роман Мавроян's user avatar
1 vote
2 answers
1k views

Effect of enabling zswap on zram without any disk swap

I have set up a system that has 4 GB RAM with 1.5 GiB of zram. It also has zswap enabled. I don't have any swap partition on the secondary storage. As I have noticed, the performance is good on my ...
15 Volts's user avatar
  • 2,009
1 vote
1 answer
1k views

After a heavy I/O load, and storing many things in Zram, used space is close to total in `free`

I do not think that this is Linux's disk cache. In htop, the memory bar is green (not orange for cache) and I removed the files stored in zram. No processes seem to be using a lot of memory. The load ...
System's user avatar
  • 31
2 votes
1 answer
556 views

How to change zram sector size?

I have cloned a disk into a sparse file that is about 80G but indeed requires only about 12G, even not compressed it fits on my memory, but in order to save some resources I want to use zram: sudo ...
Tiago Pimenta's user avatar
7 votes
1 answer
2k views

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 ...
kktsuri's user avatar
  • 315
0 votes
1 answer
76 views

compress a single file ... zram ? cloop?

We have a legacy centos 5.11 server; filesystems are ext3, we cannot change. Is it possible to have realtime compression on a single file (a giant log file) ? zram : I cannot find it in the repos... ...
Massimo's user avatar
  • 975
3 votes
1 answer
2k views

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's user avatar
8 votes
1 answer
5k views

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 ...
Tom Hale's user avatar
  • 29.4k
0 votes
0 answers
427 views

Why /sys/block/zram0/comp_algorithm not exist?

See zram kernel doc we know there should have /sys/block/zram0/comp_algorithm Examples: #show supported compression algorithms cat /sys/block/zram0/comp_algorithm lzo [lz4] #...
穆阿浩's user avatar
  • 391
12 votes
2 answers
5k views

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 ...
illiterate's user avatar
3 votes
1 answer
1k views

systemd : write a .service daemon for setting up swap and fs in zram

I recently acquired a laptop with a ssd and in order not to weigh too much on the ssd (which I was told had a limited number of write cycles), I decided to write a systemd unit file for setting up a ...
tbrugere's user avatar
  • 976
0 votes
1 answer
368 views

Have I installed and started zram successfully?

On my Kubuntu 13.10 laptop, have installed zram by sudo aptitude install zram-config and the output of swapon -s Filename Type Size Used Priority /...
qed's user avatar
  • 2,569
4 votes
0 answers
901 views

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 ...
Mikhail Morfikov's user avatar
6 votes
2 answers
2k views

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 ...
lzap's user avatar
  • 2,062
3 votes
0 answers
683 views

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 ...
Adam Ryczkowski's user avatar
18 votes
3 answers
15k views

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 ...
Ryan C. Thompson's user avatar
4 votes
1 answer
2k views

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 ...
tinuz's user avatar
  • 41
0 votes
1 answer
3k views

Zram does not start at start-up

I am using pinguyos 11.10. Pinguyos is a variant of Ubuntu 11.10. I have installed zram like this: sudo add-apt-repository ppa:shnatsel/zram sudo apt-get update sudo apt-get install zramswap-enabler ...
ashishsony's user avatar
9 votes
2 answers
8k views

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 ...
lytenyn's user avatar
  • 303
12 votes
5 answers
27k views

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 ...
Maciej Piechotka's user avatar