On Mon, Jan 11, 2021 at 1:55 PM ElXreno <elxreno(a)gmail.com> wrote:
I think it's a bad idea. It is better to make `zram-fraction`
equal to
0.8 or 0.9, but not 1.0.
Just to clarify. zram-fraction 1.0 means the zram *device size* will
be equal to RAM, capped at 8G. The actual amount of memory used is
zero, until the kernel starts to evict dirty pages to swap, where they
are then compressed. And the maximum amount of RAM due to compression
would be predicated on compression ratio. If we assume a conservative
2:1 ratio (compression results in 50% of original size), the max ram
would be the lesser of 4G or 50% of RAM.
Does this reduce your concern?
80% might still be reasonable, and still pretty conservative.
For example, if you run Darktable, load a floating-point TIFF image
into
it, and try to export it, on systems with little RAM, it will fill both
RAM itself and zram, and cause the system to freeze completely because
the memory is almost incompressible.
Also, other data (video editors, for example) which are not compressible
can get into RAM.
Are you sure that this data is compressed in memory as well as the
on-disk encoding? The editing operations themselves surely operate on
uncompressed data, and then it's compressed upon being written to
disk.
--
Chris Murphy