Advanced

Suspend to disk - does it still make sense?

Posted by Libervis on · 10 comments
Nuxified.org; By Dennis Wronka
Mail this story
Print this story

"So the problem is that with the amount of physical RAM growing people see less reason for huge swap-space, as it usually isn't needed. But then you are at risk that in situations where all your memory actually is in use you will not be able to suspend to disk."

Full Story

  Nav
» Read more about: Story Type: Editorial; Groups: Linux

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (10)

From the title I was expecting to read about the great advances that suspend to ram has taken and boot times speeding up or something along those lines. But this article seemed to be more about the need for swap space.

I have some questions though. How much hard drive space do you have? On my desktop I have 1GB of ram and 500GB of hard drive, so giving up 1-2GB is less than 1% of my available space, so I don't even think about the "lost" space. I haven't upgraded my machine in years, though with ram as cheap as it is it is temping. But hard drives are cheap as well, so it seems that it wouldn't be inconceivable for someone with 8GB of ram to have 1+TB of hard drive space, and you would still be giving up less than1% of you hard drive space for swap so what's the big deal? Especially if you want to use suspend to disk.
> On my desktop...

You don't really need or want suspend to disk on a desktop. You want it on laptops, where both memory and disk space tend to be more limited.
My rule, and the one I teach when doing support. Unless you intend to suspend to disk, swap needs to be double memory until you reach 1 gig swap space, at that point you draw the line. With this is mind thats only because I have the habit of keeping swap around. With 2 gig memory I seldom drop into swap space, and then usually less than 100 meg, and I know how to abuse a system.

If you intend to suspend to disk, then swap = system memory plus a smidge, along the lines of +10% sys memory just to be safe.
Won't 'instant-on', or at least very short boot times, make all of this hibernate/suspend stuff unnecessary?
tc: That's a matter open to debate. I happen to agree with you. Others would like to preserve some state that exists if they are in the middle of their work.
Maybe my limited end-user mind is missing something, but wouldn't it be an idea to add the ability to suspend to create a suspend-file on a regular partition if the swap partition is non-existent or too small?

It would be problem solved. Even if the "admin" of the system never took suspend to disk into account when he set up the system, the system would be able to suspend anyway.

There might be something special about swap partitions that can't be delivered by files in a regular partition. So if I'm lost in the woods, feel free to educate me.
> There might be something special about swap partitions that can't be delivered by files in a regular partition.

You can use a file as swap, or at least you could when I first started using Linux. I believe it has to be contiguous, but otherwise it's a normal file. Performance suffers, but for suspend to disk, I doubt enough to matter.
Ah, that's the rub. A file is trickier because of potential fragmentation. Well, no easy way around the swap partition then.

Thanks for the info!
I use hibernate on my desktop, so I can go back to where I was when it was time to stop using it. Though boot time, and wake up time are basically the same on that system. I use suspend to ram on the laptop because suspend to disk causes a kernel panic.
From what I know, hiberation requires a swap partition and cannot use a swap file. That is not the case with swsusp2, though, but that is not shipped with most distros.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post