What is the differences between sleep/standby and Hibernate

Source: Internet
Author: User
Tags sleep function

have you ever thought of what is the differences between sleep and hibernate options provided by Windows Vista Shutdown function? Both commands provide a easy and quick way to leave your computer in existing last State and come back to work on it at exactly the same State later without waiting too long to system to restore itself. however, fundamentally there are significant different between them that allows users to easily choose whether they shoshould use sleep or hibernate.

Sleep is commonly known as standby in Windows system or S3 in ACPI. in sleep mode, the power supply to non-essential and non-critical component is withheld, and most system operation is shutdown and stopped. all data in physical memory (RAM module) is still kept in internal memory, and whole system is place in stand-by mode, which can be woke up and used almost immediately. in sleep mode, the power load reduce considerably, saving a lot of energy. however, the power must not be cut off, and must be continue to supply to the computer. once out of power, the system will have to start again just like a newly boot computer just started from power off state.

Windows Vista has enhanced sleep mode so that on notebook computer, sleeping computer will automatically hibernate when battery power level is low. it also has built-in hybrid sleep mode which ensure that system state is preserved when there is power lost.

hibernate, or S4 In ACPI, meanwhile will save the data in physical memory to hard disk drive (HDD), and then power off the computer. in hibernate mode, a file named hiberfil. sys which has the same file size as the amount of system memory will be created on the local disk. when user wants to use the computer again, the computer will boot up and load back the state at the last hibernation. the advantage of hibernation mode is that no power is wasted for maximum saving of power. in hibernation dormancy, no Atomicity is consumed by system. beside, restore from Hibernate is generally faster than computer reboot, and is totally different from fresh start, as users can return to the exact state of last hibernation with all programs running and documents opened intact, instead of empty desktop. the disadvantage of Hibernate is that after a period of time, there may have fragmentation of file. users will need to defragment the volume that stores the hibernation file frequently.

 

The Advanced Configuration and Power Interface (ACPI) provides the following modes:

The normal working status of S0.

S1 is also called the POs (power on suspend). In this case, in addition to disabling the CPU through the CPU clock controller, other components still work normally.
The S2 CPU is stopped, the bus clock is also disabled, but other devices are still running.
All parts except the memory of S3 are stopped.
S4 memory information is written to the hard disk, and all parts stop working.
S5 shutdown.

Standby switches the system to this mode. In addition to the memory, the power supply of other devices on the computer will be interrupted. Only the memory depends on the power to maintain the data. In this way, you can directly restore to the STANDBY state when you want to recover. This mode does not completely eliminate power consumption. Therefore, if the power supply encounters an exception in the standby mode, the next time it is restarted, data that is not stored before the standby mode will be lost. However, in this mode, the recovery speed is the fastest, generally within five seconds.

Hibernate: After the system switches to this mode, the system automatically transfers all data in the memory to a sleep file on the hard disk, and then cut off the power supply to all devices. In this way, when the data is restored, the system will directly read the content of the Sleep file from the hard disk into the memory and restore it to the state before sleep. This mode does not consume power at all, so it is not afraid of Power Supply exceptions after sleep, but the cost is a hard disk space of the same size as the physical memory. The recovery speed in this mode is slow, depending on the memory size and hard disk speed.

Sleep is a new mode in Windows Vista, which combines all the advantages of standby and sleep. After the system is switched to sleep state, the system transfers all the data in the memory to the Sleep file on the hard disk (this is similar to sleep), and then disables the power supply of all devices except the memory, maintain the data in the memory (similar to the standby mode ). In this way, when we want to recover, if there is no exception in the power supply during sleep, we can recover data directly from the memory (similar to the standby mode), which is fast; however, if the power supply is abnormal during sleep, the data in the memory is lost and can be recovered from the hard disk (similar to sleep), but the speed will be slower. However, this mode will not cause data loss in any case.

Because the sleep function has so many advantages, the power button on the Windows Vista Start Menu will switch the system to sleep mode by default. Therefore, we can make full use of this new function. After all, it is much faster to recover from sleep than to start from scratch. In addition, the sleep mode does not keep going. If the system is not woken up after a period of time (which can be set for a specific time), it is automatically transferred to sleep status, power off the memory to further reduce energy consumption.

Remarks: Chinese ReferenceArticleIt is said that S1/S3 can set the standby mode in the BIOS. It is required to be S1 or S3, and S1 and S3 cannot coexist. However, Some motherboards support the S1 & S3 status, that is to say, the memory is still working. When other components stop working, the CPU enters the halt/stop status and can respond to mouse or keyboard interruptions to wake up the system.

English reference: http://www.360doc.com/content/09/0609/10/59579_3825214.shtml

Http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface:

 

Summary:

1. in Windows XP, "standby" or "standby" is actually suspend to ram, that is, S3 in ACPI.

This is why the system disk that has been encrypted is not prompted to enter the password for decryption after "standby" is run and the system is awakened.

2. Standby: suspend to Ram (suspended to memory) status, STR for short. STR stores all the operating status data before the system enters STR in the memory. In the STR state, the power supply continues to power the most necessary devices, such as memory, to ensure that data is not lost, while other devices are in the off state, and the power consumption of the system is extremely low. Once the system is awakened, the system immediately reads data from the memory and restores it to the operating state before Str.

3. hibernate: that is, suspend to disk (suspended to the hard disk) status, STD for short, where data is stored in the hard disk.

After you press the power button to power on the motherboard, the BIOS starts. After the ntldr of Windows XP is started, if the hiberfil is found in the system root directory. if the Sys File is valid, ntldr reads hiberfil. information in the SYS file and restore the system to the state before hibernation. At this time, boot is not processed. INI file.

If the system disk is encrypted, you need your own bootProgram(Bootloader) before ntldr or bootmgr is started, the user is prompted to enter the password, mount and decrypt hiberfil. the partition where the Sys File is located, that is, boot. boot partition where ini or BCD (BOOT configuration data) is located, and then jump to ntldr or bootmgr to start the normal startup process.

4. DM-crypt: encrypt the swap partition. You cannot use random data as the key. Because the hibernate file is saved in the SWAp partition, The Hibernate file cannot be correctly read after restart. Linux boot programs (such as grub) need to mount the swap partition, prompting the user to enter the password or read the key file from a specific place, otherwise the system will fail to wake up.

5. The reason why enhanced write filter in Windows XP embedded and Windows Embedded Standard 7 supports the limitations of Hibernate is described in the following article.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.