systemd-oomd issues on desktop

Dan Streetman ddstreet at
Mon Jun 13 00:50:38 UTC 2022

On Fri, Jun 10, 2022 at 2:16 PM Sebastien Bacher <seb128 at> wrote:
> Le 09/06/2022 à 21:19, Dan Streetman a écrit :
> > Personally, I think this is the correct option. 1GB is not a good
> > default swap size.
> Did we ever consider doing the same than fedora is doing there?

compressed swap is generally good, when used lightly, and both zram
and zswap are good options, however each has significant downsides.
For zram, the downside is the unpredictability of pages that need to
be swapped, meaning some pages might be very poorly compressible; it
would be better to simply write out such pages to disk, but zram (when
acting as a swap device) isn't able to 'reject' poorly compressible
pages, which means the actual performance improvements of zram can be
highly variable depending on workload. Alternately zswap is able to
'reject' poorly compressible pages (i.e. let them get written to
disk), but the downside is you actually must have real disk swap
configured (because of how zswap is designed, using the 'frontswap'
hook); it can't do memory-only swap compression like zram.

One downside of both approaches (assuming a zram system also has
'fallback' real disk swap) is zram/zswap will fill up with swapped
pages (by design, obviously). If they get filled up (even partially)
with pages that really don't need to be accessed for a long time,
those compressed pages will stick around in memory, taking up space,
when it would have been better to simply write them out to disk. This
is particularly problematic once zram or zswap become 'full'. For
systems with *only* zram swap, this isn't an issue, since the only
options are 1) the page is in ram uncompressed or 2) the page is in
zram compresssed, which is why zram is particularly well suited to
embedded/iot systems without any disk swap.

The fedoraproject page there does lay out the comparison quite well,
but I'm not so sure enabling either by default for all users would be
appropriate. Also, I moved on from being an active zswap maintainer
years ago, so it's possible things have changed.

> Cheers,
> Sebastien Bacher
> --
> ubuntu-devel mailing list
> ubuntu-devel at
> Modify settings or unsubscribe at:

More information about the ubuntu-devel mailing list