Comment 3 for bug 599352

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

Surely the size needed is not an exact science. You need the amount of memory /currently in use/ (excluding caching) plus 4Mb, not the amount of RAM present. If the machine is using swap then total memory + 4Mb may not be enough. IIRC, the algorithm is that cache it thrown out, and everything remaining in memory is copied to swap.

Therefore no swap size is guaranteed to allow hibernation. Even if you have 4GB RAM and 32GB swap, if you happen to have 33GB virtual memory in use, you cannot hibernate.

The best solution would be a real-time check that the system at present is using less memory than the swap size (+4Mb) - even better it should have a message in it's place, like "Hibernation not available - too much memory in use. Shut down applications and retry".