||This article needs additional citations for verification. (October 2011)|
Hibernation (or Suspend to disk) in computing is powering down a computer while retaining its state.
Upon hibernation, the computer saves the contents of its random access memory (RAM) to a hard disk or other non-volatile storage. Upon resumption, the computer is exactly as it was upon entering hibernation.
When used to save power, hibernation is similar to sleep mode and saves more power at the cost of slower resumption.
Hibernation saves electrical power. After hibernating, the hardware is completely powered down (just like for a regular shutdown). Therefore a hibernated machine uses no more electrical power than one which is switched off. Hibernation is a means of avoiding the burden of saving unsaved data before shutting down and restoring all running programs after powering back on.
Hibernation is used in laptops, which have limited battery power available. It can be set to happen automatically on a low battery alarm. Most desktops also support hibernation, mainly as a general energy saving measure.
In some cases entering into hibernation can cause incorrect operation on restarting, due to problems with the hibernation software, or with devices or software which is not fully compliant. Hibernation will also usually cause connections to peripheral devices to terminate; this may cause problems for peripherals that were in use when hibernation started.
Some organizations (mainly large enterprises) mandate automatic hibernation (e.g. as a network policy) if a computer system has been idle for a certain amount of time, mainly as an energy saving measure. This saves some energy at the cost of some lost productivity waiting for the state to be restored.
Comparison to sleep mode
Many systems also support a low-power sleep mode or stand by mode in which the processing functions of the machine are powered down, using a little power to preserve the contents of RAM and support waking up; wakeup is almost instantaneous.
The advantage of sleep mode is that resuming is much quicker than for hibernation. A hibernated system must start up, then read back data to RAM on resuming, which typically takes about ten seconds or more. A system in sleep mode only needs to power up the CPU and display, which is almost instantaneous. On the other hand, a system in sleep mode still consumes some power, while a hibernated system does not require any power at all. A sleeping computer is a case of a device consuming standby power, covered by regulations in many countries limiting such power under the One Watt Initiative to one watt from 2010. Since these facilities were introduced, most systems have come to offer both sleep mode and hibernation.
Sleep mode and hibernation can be combined: The contents of RAM are copied to non-volatile storage and the computer enters sleep mode. This approach combines the benefits of sleep mode and hibernation: The machine can resume instantaneously, and its state, including open and unsaved files, will survive a power outage.
Operating system support
On Windows computers, hibernation is available only if all hardware is ACPI and Plug-and-play compliant, and additionally all drivers are PnP-compatible. The Microsoft Help and Support website also describes a command line instruction to invoke hibernation, in article #555569; such command line instructions can be added to many keyboard instruction sets to hibernate computers at the touch of a (programmable) button.
Windows 95 supported hibernation through hardware manufacturer-supplied drivers and only if compatible hardware and BIOS were present. Since Windows 95 supported only Advanced Power Management (APM), hibernation was then known as Suspend-to-Disk. Windows 98 and later support ACPI. However, hibernation often caused problems since most hardware was not fully ACPI 1.0 compliant or did not have WDM drivers. There were also issues with the FAT32 file system.
Windows 2000 was the first Windows release to support hibernation at the operating system level (OS-controlled ACPI S4 sleep state) without special drivers from the hardware manufacturer. A file, "hiberfil.sys" is used to store the contents of RAM when the computer hibernates, and was of the same size as the total RAM. A hidden system file resides in the root of the system partition, usually "C:\hiberfil.sys".
Windows XP further improved support for the hibernate function. Hibernation and resume-from-hibernate are much faster as memory pages are compressed using an improved algorithm, compression is overlapped with disk writes, unused memory pages are freed and DMA transfers are used during I/O. The hibernation file is a full snapshot of the physical RAM memory compressed with an Xpress algorithm, and contains further information including processor state. This file was documented by a security researcher Matthieu Suiche during Black Hat Briefings 2008 who also provided a computer forensics framework to manage and convert this file into a readable memory dump. The Xpress compression algorithm was later documented by Microsoft as well.
Windows Vista introduced a Hybrid Sleep feature for desktop computers, which when enabled, combines hibernation with standby (sleep) by saving the contents of volatile memory to hard disk before entering sleep mode. If power to memory is lost, it will use the hard disk to wake up. Users have the option of hibernating directly without enabling hybrid sleep if they wish.
Windows 7 introduced compression to the hibernation file and set the default size to 75% of the total physical memory. Microsoft also recommends to increase the size using the powercfg.exe tool in some rare workloads where the memory footprint exceeds that amount. It can be set from anywhere between 50% to 100%, although decreasing it is not recommended.
Windows 8's resume-from-hibernation algorithm is multi-core optimized. Windows 8 also introduces a Hybrid Boot feature. When users select the Shut Down option, it hibernates the computer, but closes all programs and logs out the user session before hibernating. According to Microsoft, a regular hibernation includes more data in memory pages which takes longer to be written to disk. In comparison, when the user session is closed, the hibernation data is much smaller and therefore takes less time to write to disk and resume. Windows 8 also saves the kernel image. Users have the option of performing a traditional shutdown by holding down the Shift key while clicking Shut Down.
Hibernate is often under-used in business environments as it is difficult to enable post-deployment without resorting to third-party PC power management software This omission by Microsoft has been criticized as having led to a huge waste in energy.
There is a significant market in third-party Power Management Software offering features beyond those present in the Windows operating system. available. Most products offer Active Directory integration and per-user/per-machine settings with the more advanced offering multiple power plans, scheduled power plans, anti-insomnia features and enterprise power usage reporting. Notable vendors include 1E NightWatchman, Data Synergy PowerMAN (Software), Faronics Power Save and Verdiem SURVEYOR.
Windows hibernation mode can be disabled as well as the side benefit of deleting the hiberfil.sys file using a simple command.
Mac OS X
On Macs, a feature known as Safe Sleep saves the contents of volatile memory to the system hard disk each time the Mac enters Sleep mode. The Mac can instantaneously wake from sleep mode if power to the RAM has not been lost. However, if the power supply was interrupted, such as when removing batteries without an AC power connection, the Mac would wake from Safe Sleep instead, restoring memory contents from the hard drive. Because Safe Sleep's hibernation process occurs during regular Sleep, the Apple menu does not have a "hibernate" option.
Shortly after Apple started supporting Safe Sleep, Mac enthusiasts released a hack to enable this feature for much older Mac computers running Mac OS X v10.4. Classical Mac OS once also supported hibernate, but this feature was dropped by Apple.
In the Linux kernel, Hibernate or suspend-to-disk, suspend-to-ram, suspend-to-file is implemented by swsusp which is built into the 2.6 series. An alternative implementation is TuxOnIce which is available as patches for the 3.4 kernels. Other alternative implementations also exist, namely uswsusp (user-space suspend). TuxOnIce provides advantages such as support for SMP, 4GB high mem and preemption.
- Advanced Configuration and Power Interface
- Green computing
- PC power management
- Sleep mode
- "Turn off a computer: frequently asked questions". Windows Vista Online Help. Microsoft Corporation. Retrieved 15 October 2011.
- "Sleep and hibernation: frequently asked questions". Windows 7 Online Help. Microsoft Corporation. Retrieved 15 October 2011.
- ACPI Specification Rev 3.0b
- Microsoft Help and Support – How To Put the System into hibernation or Standby from Run menu
- BIOS and Hibernate Issues for FAT32 File System
- "Interview with Nicolas Coudière, Chief Product Manager: Microsoft Windows Millennium Edition (Me)". Activewin.com. Retrieved 2010-08-26.
- "Windows Power Management". Microsoft.com. 2001-12-04. Retrieved 2010-08-26.
- Windows Power Management: Instant PC availability and energy savings
- Kernel Enhancements for Windows XP
- BlackHat USA 2008 – Windows hibernation file for fun and profit
- SandMan Computer Forensics Framework
- "Reducing the Disk Footprint for Windows 7 Hibernation". Retrieved 2012-10-25.
- Delivering fast boot times in Windows 8
- Enable hibernate using group policy
- EcoGeek – How Windows XP Wasted $25 Billion of Energy
- "Power Management Software for Windows Workstations".
- "Energy Star Commercial Packages List".
- The Headmasters' and Headmistresses' Conference. "HMC: A Practical Guide to Sustainable Building for Schools".
- "PC Power Management Solutions".
- "Why use software NightWatchman to turn your PCs off?".
- "University of Oxford Low Carbon Project: Energy and the networked computing environment".
- "Forrester Study: Total Economic Impact of Faronics Power Save".
- "1E upgrades NightWatchman, seeks to bring powermanagement to SMEs: Competitive landscape".
- How to disable and re-enable hibernation on a computer that is running Windows; Microsoft; August 12, 2010.
- Apple Support: Progress bar appears after waking from sleep