Comment 17 for bug 599352

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Maverick] Need to not display hibernation in UI if do not have enough swap space

I just checked the code again, and it was actually the other way around. The previous 80% was a bug in the wrong direction, it meant that you can only hibernate if your active memory is up to 80% of available swap space (not the inverse, as I originally thought). So this severely erred on the side of caution, and I'll fix it upstream to be 99% instead.

I also tested a hibernate attempt with not having enough swap, and confirm that upower fails with a D-Bus error message right away:

$ dbus-send --system --print-reply --dest=org.freedesktop.UPower --reply-timeout=60000 /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
Error org.freedesktop.UPower.GeneralError: Not enough swap space

However, this isn't shown anywhere in the UI.

Now, the thing which is actually wrong in upower is that it checks available swap/used memory at the time when it starts up, instead of when you attempt to hibernate. I'll fix that.