On Fri, Sep 14, 2018 at 08:07:35PM -0400, Ray Strode wrote:
Systemd compares the amount of memory used to the available swap space and does not offer hibernation if there isn't enough. I haven't seen reports that this calculation is not done properly.
I was told years ago that there's no way userspace can reliably know, and even if we activated a dedicated bigger-than-memory sized swap partition immediately before hibernate started it could still fail. maybe things have improved since then, or maybe it wasn't accurate information. dunno.
I think the issue is that it's it's _possible_ that a out-of-control process could suddenly eat up a bunch of memory and go to swap right at the wrong time. If there's enough space, this is unlikely in practical use. I'm not super worried, because realistically that out-of-control processes and runaway swap thrashing was going to take your system down or at the very least trigger OOM killing *anyway*.