How big swap do I need for suspending to RAM?

I have been reading a lot of articles about swap size. As far as I understand in old days the rule has been swap = x2 RAM as the machines had little memory at that time. Red Hat seems to recommend certain swap sizes based on RAM size. Also some sources explain that it is related to the hibernation but I can’t find info for suspending to RAM only.

My situation is:

  • I want to be able to suspend to RAM only
    (not hibernation to disk) - I have 32GB RAM

How big should my swap partition be?

Wen you want to suspend 32 GB of memory to your swap, you obviously need 32 GB of swap.

But I understand that compressing is used, so you need less. But how much? Just take 32 GB and you will be fine imho.

For “suspend to RAM” it doesn’t matter, as this doesn’t use the swap at all. “suspend to disk” saves everything from RAM to the swap partition and therefore needs a large enough swap.

In general, how large your swap should be (or if you need one at all) mainly depends on your usage.
The more RAM you have, the less likely it is that you need swap at all though.
Personally I have “only” 2GiB RAM and 2 GiB swap here, so you probably can do without, or with just a small one.

Hm. But why?

As far as I know: Suspending to RAM means the information stays in the RAM, i.e. there is voltage on the RAM chips while everything else is turned off. So it is supposed there is no writing to disk?

I might be wrong but I think this is the main difference between Sleep and Hibernate. And because this is not distinguished in any article I read it is quite confusing for me.

Exactly as I thought. Thanks for explaining.

Well… currently I have 2GB of swap but I can’t suspend, The screen goes black but stays on and the machine stays on. And I can’t wake it. I can only make a cold reset or power off manually which is obviously not clean. I thought it might be because of the too small swap but I am starting to question that. This is the third re-install I am fighting it.

Any idea what might be wrong?

Some laptops just have trouble suspending to RAM. I assume this is a laptop? The laptop I’m running here cannot recover from suspend. It provides a black screen.

What model do you have?

Not a laptop. It’s a desktop machine. MB is Asus P8Z77-V. Windows 7 can sleep this machine without problem.

As for laptop: My very old laptop (512mb RAM) is running openSUSE 13.2 and can sleep, hibernate and wake without problem. But this desktop can’t (I tried Tumbleweed before but it was the same).

More info: When attempting a suspend to RAM and the screen goes black, the Caps Lock and Scroll Lock start blinking.

The present title of your thread does not cover at all what seems to be your real problem. To draw the attention of the people you need, it might be better to start a new thread which a title that contains the key-words to your problem.

Quite right, Henk. I have opened a new thread.