Not enough free swap space to hibernate

Vincent Arnoux vincent.arnoux at gmail.com
Wed Mar 25 16:39:55 UTC 2009


On Wed, Mar 25, 2009 at 16:31, Derek Broughton <derek at pointerstop.ca> wrote:
> You can't force your swap to be emptied (except by stopping all processes),
> though you can minimize it by making sure you're using no more programs
> than can fit in your real memory and then doing something with all of those
> programs (to force them to swap back in), and you can't expect to be able
> to hibernate with no more swap memory than real memory.
>
> While there's a lot more actually happening, think of hibernation as simply
> swapping out _all_ current processes.  This means that you need enough
> space in there for all the storage of all the current programs, which
> generally means about 2x your real memory.
>
> otoh, if you simply save your virtual machines (ie, hibernate them in their
> own files), you shouldn't have an issue with your other memory.  Hibernate
> supports the concept of stopping/starting services when hibernating and
> resuming, so you could write a script to save/restore the VMs.

Yes, that's what I observed: if I save the virtual machine and shut
down VMWare, some pages will remain in swap even if RAM will drop.
Hence, if at this time RAM in use + swap in use > 1 GB, I won't be
able to hibernate. Using swapoff/swapon empties my swap and then I am
sure that I will have enough room to store my RAM when hibernating.
I just need now to find where to call a script doing the
swapoff/swapon before hibernating.

Vincent




More information about the ubuntu-users mailing list