Quantcast
Channel: Error -12 hibernation image. Not enough free memory (sometimes) - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4

Answer by user99306 for Error -12 hibernation image. Not enough free memory (sometimes)

$
0
0

I believe that I have found a partial solution here. If I enter the command:

sudo sync && sudo sysctl -w vm.drop_caches=3

Prior to attempting to hibernate, I no longer have a problem and it hibernates first time, every time. This appears to empty the cache, therefore leaving plenty of memory (RAM) free to create the image.

I am no programmer, but it seems illogical that Ubuntu doesn't do this prior to hibernation anyway? It obviously does something similar as repeated hibernation attempts have the same result eventually, but clearly it doesn't do it before attempting to hibernate. Surely it is inefficient when hibernating to also write all the buffers and cache to disk too, as they will also have to be re-loaded on resume, even if they are no longer needed. Surely it would be more efficient if Ubuntu dumped the cache, or at least parts that haven't been used for some time, before hibernation?

The fact it doesn't do this is probably the reason why it is recommended to have double the size of the RAM for swap space; terribly inefficient especially in the days of SSDs where if you have 16GB of RAM, you'd lose 32GB (potentially half of your HD space) of space to a swap file that is only ever used to hibernate.

With the ever increasing sizes of RAM, I'd say that this is an area that needs looking into. HD space may be cheap, but that is no excuse to waste it due to inefficiencies.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>