Doubling down on my point from yesterday that we don't care enough about proper OOM management.

I just played around with a giant zram device just see if we can make way more use of compressed memory.

Turns out yes, suddenly my Firefox on Linux holds 250 tabs in memory without any disk-backed swap.

Kinda makes the point that having a fixed-size zram device is a bad idea, and the kernel should just compress as much memory as possible?

zramctl shows 20 GB compressed down to 4.7 GB, and this is not testing with flooding memory with zeros, this is my actual Firefox session with tons of different tabs.
main/postmarketos-zram: increase default zram factor/size to 150% (ffb0d171) · Commits · postmarketOS / pmaports · GitLab

This "size"/factor/percentage represents the total amount of **uncompressed** data that is allowed to be written to the zram-backed swap device. It is **not** the amount of RAM to use for...

GitLab

@zyx yes, the size of the zram disk is the max size of the uncompressed data that can then be compressed by the zram module (see https://docs.kernel.org/admin-guide/blockdev/zram.html).

In the case of my firefox tabs here, it seems like a 4:1 compression ratio is achieved, so that would make the case for a zram device as large as 400%.

zram: Compressed RAM-based block devices — The Linux Kernel documentation