zramd icon indicating copy to clipboard operation
zramd copied to clipboard

Zramctl does not show the correct size of the swap

Open Alex-Bujorianu opened this issue 4 years ago • 0 comments

I have set the fraction to 0.5 and the maximum_size to 16384MB, but running zramctl or the system monitor shows the size of the zram swap to be 7.5GB. It’s supposed to be 16GB, as that is the uncompressed maximum. This is a problem, because I want to run a script which automatically frees the swap if there is enough free memory. If the number reported is incorrect, so e.g. there are 5GB of pages in swap but the uncompressed size is more like 10GB, this could crash my system by leading to an out-of-memory condition.

Alex-Bujorianu avatar Sep 18 '21 18:09 Alex-Bujorianu