Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Ryan_Vickers

[Guide] What is sleep?

Recommended Posts

Posted · Original PosterOP

This will be a short post as there isn't much to this topic unless you want to get into really technical details, which is why I've avoided doing it all these years, but I decided finally it is probably worth having.  Speaking of those technical details, if you feel like adding them below, go ahead :)

 

Sleep

This is also sometimes called "Standby", "Suspend to RAM" or just "Suspend".  In this state, your computer basically "pauses" all execution, and then cuts or significantly reduces power to most of the hardware (drives, CPU, etc.).  RAM continues to receive power because without it, the data would slowly fade, become corrupt, and be lost.  Because of this, on battery, you will still draw power until the battery eventually dies and power is lost, but power draw is very small so this could take days or even weeks.  Because everything is still stored in RAM, resuming or "waking up" from this state is very quick, taking usually only a few seconds at most, but if power is lost completely while sleeping, it's no different than if power had been lost while running normally - ie, it counts as an improper shutdown.  In sleep mode, the computer is capable of "listening" for things that can wake it up (laptop lid being opened, keyboard press, etc.) but, as mentioned, no execution happens.  You cannot download files or host a shared folder while sleeping for example.

 

If you are going to be away from your system for long enough that it doesn't make sense to keep it on, but short enough that it doesn't make sense to shut down (say, between 10 minutes and an hour, but this is subjective), sleep is the recommended state to put your system into.

 

Hibernation

This is sometimes called "suspend to disk".  In this state, your computer takes everything in RAM and writes it to the hiberfil.sys (in windows) or the swap partition (in Linux), then physically turns off, no different than if you had shut down.  When turning your computer back on, you will go through POST, have access to the BIOS, and (if you dual boot) have access to GRUB or your bootloader of choice.  Once an operating system is selected though, rather than booting normally, it will simply reload everything from that file to RAM, and then continue running as if nothing had happened.  In this way (from the software's perspective) it is the same as sleep, but from the hardware's perspective, it's the same as being shut down.

 

There are several reasons why you should or should not use hibernation.  If you dual boot and need to switch OSes routinely without stopping what you were in the middle of, it's a fantastic option.  If you still have a HDD as a boot drive (please don't do this), hibernating whenever possible instead of shutting down will likely improve your off-to-ready times considerably.  Not only do you skip the login phase, but booting itself is faster too in my experience.  I theorize this is because loading one large sequential file is faster than many small files, even if the total amount of data is actually larger, but that's just a guess.  If you have an SSD, you're probably better off shutting down and booting normally though.  In my experience it's faster, and it'll put less wear on your drive.  If you need to pause what you're doing for an extended period of time, or through a period where you will likely lose power, hibernation should be used.

 

As I mentioned earlier, in Windows, the file used for hibernation is not the page file, and so if you don't intend to ever hibernate, you can disable it with the command powercfg.exe /hibernate off.  Doing so may save you several GB on your C drive, as it seems to hold data even when not in use for some reason... perhaps to make sure there's room when needed?  I actually don't know.

 

Hybrid Sleep

This is a feature added in Windows Vista that basically combines the two methods mentioned above.  If my understanding is correct it's also available in MacOS under the name "safe sleep".  If you have this enabled, putting your computer to sleep will cause it to write the hiberfil as if you were going into hibernation, but it will then sleep normally.  If you are able to, you can then resume quickly from sleep as if you'd just slept normally, but if power was lost, the hiberfil is there to resume from as if you had just hibernated normally.  Personally I am not a fan since I am capable of choosing the appropriate method to use manually and this combines both the good, and the bad of both, but to each their own.  It's worth noting that this might be enabled by default, so if you've always found going to sleep takes a long time and has a lot of disk activity associated with it (something that in pure sleep will not happen), you might want to check that in Power Options.

 

Fast Startup

Unlike everything else in this list, this isn't a method of suspending execution, but it uses some of the same mechanisms so I thought I'd explain it here.  Basically, if you shut down when this is enabled, parts of the system are saved using a technique similar to hibernation, but the "user stuff" is not, so you effectively get a clean boot*, but perhaps a little faster than it would otherwise be doing it in the traditional way.  I have not experimented with this myself enough to know when if ever it should be used, or the various up and down sides, but it's something you should be aware of.

 

* It will not save what you were doing but it's possible that things which would be fixed by a traditional reboot would not be fixed when doing this, so keep that in mind.

 

 

As usual, I hope this has been useful, and if you have any corrections you'd like to suggest please let me know below! :)

Link to post
Share on other sites

Thanks, would've been nice to know this years ago lol :P

 

 

This'll probably help a ton in the future, thanks again for taking the time to make this :D 


Quote me to see my reply!

SPECS:

CPU: Xeon X5650 OC'd to 4.4GHz @ 1.36V (courtesy of @XR6) Motherboard: Asus Sabertooth X58 RAM: 4x4GB G.Skill DDR3 1866MHz GPU: Asus RX 570 Strix Storage: WD Blue 1TB and a 128GB Kingston UV400 PSU: EVGA 600B Case: Fractal Design Define C Monitor: Dell G2410T and two Dell P2210 on a Steelcase Eyesite triple monitor stand Mouse: Logitech G403 Prodigy Wireless Keyboard: Dell AT101 GYUM97SK with white Alps and Lite-on SK-2002 keycaps Mousepad: Steelseries QcK Headset:  Sennheiser HD598SE

 

I like old-ass keyboards, Volvos, Thinkpads, and fountain pens.

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×