HOME

TheInfoList



OR:

Hibernation (also known as suspend to disk, or Safe Sleep on Macintosh computers) in computing is powering down a computer while retaining its state. When hibernation begins, the computer saves the contents of its
random access memory Random-access memory (RAM; ) is a form of electronic computer memory that can be read and changed in any order, typically used to store working data and machine code. A random-access memory device allows data items to be read or written ...
(RAM) to a
hard disk A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating hard disk drive platter, pla ...
or other
non-volatile storage Non-volatile memory (NVM) or non-volatile storage is a type of computer memory that can retain stored information even after power is removed. In contrast, volatile memory needs constant power in order to retain data. Non-volatile memory typ ...
. When the computer is turned on the RAM is restored and the computer is exactly as it was before entering hibernation. Hibernation was first implemented in 1992 and patented by
Compaq Computer Corporation Compaq Computer Corporation was an American information technology, information technology company founded in 1982 that developed, sold, and supported computers and related products and services. Compaq produced some of the first IBM PC compati ...
in
Houston Houston ( ) is the List of cities in Texas by population, most populous city in the U.S. state of Texas and in the Southern United States. Located in Southeast Texas near Galveston Bay and the Gulf of Mexico, it is the county seat, seat of ...
, Texas. Microsoft's
Windows 8 Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on August 1, 2012, made available for download via Microsoft ...
, Windows 8.1,
Windows 10 Windows 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was Software release cycle#Release to manufacturing (RTM), released to manufacturing on July 15, 2015, and later to retail on July 2 ...
and
Windows 11 Windows 11 is a version of Microsoft's Windows NT operating system, released on October 5, 2021, as the successor to Windows 10 (2015). It is available as a free upgrade for devices running Windows 10 that meet the #System requirements, Windo ...
employ a type of hibernation (Fast Startup) by default when shutting down.


Uses

After hibernating, the hardware is powered down like a regular shutdown. The system can have a total loss of power for an indefinite length of time and then resume to the original state. Hibernation is mostly used in
laptop A laptop computer or notebook computer, also known as a laptop or notebook, is a small, portable personal computer (PC). Laptops typically have a Clamshell design, clamshell form factor (design), form factor with a flat-panel computer scree ...
s, 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 and allows for replacement of a removable battery quickly. Google and Apple mobile hardware ( Android,
Chromebook Chromebook (sometimes stylized in lowercase as chromebook) is a line of laptops, desktops, tablets and all-in-one computers that run ChromeOS, a proprietary operating system developed by Google. Chromebooks are optimised for web access. They al ...
s, iOS) do not support hibernation. Apple hardware using
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
calls hibernation Safe Sleep. A real-time clock alarm can be scheduled to wake the machine after hibernation.


Comparison to sleep mode

Many systems support a low-power sleep mode in which the processing functions of the machine are lowered, using a trickle of power to preserve the contents of RAM and support waking up. Instantaneous resumption is one of the advantages of sleep mode over hibernation. A hibernated system must start up and read data from permanent storage and then transfer that back to RAM, which takes longer and depends on the speed of the permanent storage device, often much slower than RAM. 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 power to keep the data in the RAM, and thus cannot last indefinitely, as hibernation can. Detaching power from a system in sleep mode results in data loss, while cutting the power of a system in hibernation has no risk; the hibernated system can resume when and if the power is restored. Both shut down and hibernated systems may consume standby power unless they are unplugged. Hibernation is a means of avoiding the burden of saving unsaved data before shutting down and restoring all running programs and re-opening documents and browser tabs. Both hibernation and sleep preserve memory fragmentation and atrophy that lead to mobile devices working poorer the longer they run without a full reboot. This is why many experts recommend a frequent shut down or reboot of electronic devices.


First implementation

The first working retail hibernation was in 1992 on the Compaq LTE Lite 386 as noted in its sales material. It is made possible in part due to the sleep and protected mode
opcode In computing, an opcode (abbreviated from operation code) is an enumerated value that specifies the operation to be performed. Opcodes are employed in hardware devices such as arithmetic logic units (ALUs), central processing units (CPUs), and ...
s in the Intel 386 CPU. It was implemented in ROM and worked independently of the operating system with no drivers needed. The LTE would sense low battery and prevented data loss by making use of a hidden partition. It preserved and restored the system in the midst of disk writes and operations with a math co-processor. It could also be controlled using an optional software GUI or a customized keyboard shortcut. It was tested on DOS, Windows 3.1, Banyan Vines, and Novell Netware. Compaq's hibernation is also noted in an IBM patent from 1993.


Operating system support

Early implementations of hibernation used the
BIOS In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is a type of firmware used to provide runtime services for operating systems and programs and to perform hardware initialization d ...
as noted above, but modern operating systems usually handle hibernation themselves. Hibernation is defined as sleeping mode S4 in the ACPI specification.


Microsoft Windows

On Windows computers, hibernation is available only if all hardware and
device driver In the context of an operating system, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabli ...
s are ACPI and plug-and-play–compliant. This allows some desktop computers to hibernate quickly to SSD in the event of a power failure and power supplied to even a lightweight or aging UPS. Hibernation can be invoked from the Start menu or the command line.
Windows 95 Windows 95 is a consumer-oriented operating system developed by Microsoft and the first of its Windows 9x family of operating systems, released to manufacturing on July 14, 1995, and generally to retail on August 24, 1995. Windows 95 merged ...
supports hibernation through hardware manufacturer-supplied drivers and only if compatible hardware and BIOS are present. Since Windows 95 supports only Advanced Power Management (APM), hibernation is called Suspend-to-Disk.
Windows 98 Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the second operating system in the 9x line, as the successor to Windows 95. It was Software ...
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, making hibernation problematic and unreliable.
Windows 2000 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
is the first Windows to support hibernation at the operating system level (OS-controlled ACPI S4 sleep state) without special drivers from the hardware manufacturer. A hidden system file named "" in the root of the boot partition is used to store the contents of RAM when the computer hibernates. In Windows 2000, this file is as big as the total RAM installed.
Windows Me Windows Me (Millennium Edition) is an operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the successor to Windows 98, and was released to manufacturing on June 19, 2000, and t ...
, the last release in the
Windows 9x Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
family, also supports OS-controlled hibernation like Windows 2000 and requires disk space equal to that of the computer's RAM.
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
further improved support for hibernation. Hibernation and resumption 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. contains further information including processor state. This file was documented by security researcher Matthieu Suiche during
Black Hat Briefings Black Hat Briefings (commonly referred to as Black Hat) is a computer security conference that provides security consulting, training, and briefings to hackers, corporations, and government agencies around the world. Black Hat brings together ...
2008 who also provided a computer forensics framework to manage and convert this file into a readable memory dump. The compression feature was later documented by Microsoft as well. Although Windows XP added support for more than 4
gigabyte The gigabyte () is a multiple of the unit byte for digital information. The SI prefix, prefix ''giga-, giga'' means 109 in the International System of Units (SI). Therefore, one gigabyte is one billion bytes. The unit symbol for the gigabyte i ...
s of memory (through Windows XP 64-bit Edition and Windows XP Professional x64 Edition), this operating system, as well as
Windows Server 2003 Windows Server 2003, codenamed "Whistler Server", is the sixth major version of the Windows NT operating system produced by Microsoft and the first server version to be released under the Windows Server brand name. It is part of the Windows NT ...
,
Windows Vista Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
and Windows Server 2008 do not support hibernation when this amount of memory is installed because of performance issues associated with saving such a large pool of data from RAM to disk. This would later be resolved by
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
and Windows Server 2008 R2. Windows Vista introduced a ''hybrid sleep'' feature, which saves the contents of memory to hard disk but instead of powering down, enters sleep mode. If the power is lost, the computer can resume as if hibernated. Windows 7 introduced compression to the hibernation file and set the default size to 75% of the total physical memory. Microsoft also recommends that the size be increased using the powercfg.exe tool in some rare workloads where the
memory footprint Memory footprint refers to the amount of main memory that a program uses or references while running. The word footprint generally refers to the extent of physical dimensions that an object occupies, giving a sense of its size. In computing, t ...
exceeds that amount. It can be set from anywhere between 50% and 100%, although decreasing it is not recommended.
Windows 8 Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on August 1, 2012, made available for download via Microsoft ...
also introduces a ''Fast startup'' 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. Users have the option of performing a traditional shutdown by holding down the ''Shift'' key while clicking ''Shut Down'' and it is also possible to shut down a computer in the traditional way by disabling Fast Startup in the system settings.
Windows 10 Windows 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was Software release cycle#Release to manufacturing (RTM), released to manufacturing on July 15, 2015, and later to retail on July 2 ...
mirrors Windows 8 as noted by Microsoft. Windows 10's hibernation algorithm is solid-state drive optimized. This behavior is carried over to
Windows 11 Windows 11 is a version of Microsoft's Windows NT operating system, released on October 5, 2021, as the successor to Windows 10 (2015). It is available as a free upgrade for devices running Windows 10 that meet the #System requirements, Windo ...
. Hibernation is often underused in business environments as it is difficult to enable it on a large network of computers 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. It is possible to disable hibernation and delete hiberfil.sys. Third-party PC power management software offers features beyond those present in Windows. Most products offer
Active Directory Active Directory (AD) is a directory service developed by Microsoft for Windows domain networks. Windows Server operating systems include it as a set of processes and services. Originally, only centralized domain management used Active Direct ...
integration and per-user or per-machine settings with more advanced power plans, scheduled power plans, anti-insomnia features and enterprise power usage reporting.


macOS

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. Safe Sleep capability was added in Mac models starting with the October 2005 PowerBook G4 (Double-Layer SD). Safe Sleep requires Mac OS X v10.4 or higher. 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. The
classic Mac OS Mac OS (originally System Software; retronym: Classic Mac OS) is the series of operating systems developed for the Mac (computer), Macintosh family of personal computers by Apple Computer, Inc. from 1984 to 2001, starting with System 1 and end ...
once also supported hibernation, but this feature was dropped by Apple.


Linux

In the
Linux kernel The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
, hibernation is implemented by swsusp which is built into the 2.6 series. An alternative implementation is TuxOnIce which is available as patches for the kernel version 3.4. TuxOnIce provides advantages such as support for
symmetric multiprocessing Symmetric multiprocessing or shared-memory multiprocessing (SMP) involves a multiprocessor computer hardware and software architecture where two or more identical processors are connected to a single, shared main memory, have full access to all ...
and preemption. Another alternative implementation is uswsusp. All three refer to it as "suspend-to-disk". systemd, if deployed, manages hibernation itself.


Hybrid sleep

Sleep mode and hibernation can be combined: the contents of RAM are copied to the 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, survives a power outage. Hybrid sleep consumes as much power as sleep mode, whereas hibernation powers down the computer.


See also

* Green computing * PC power management


References

{{DEFAULTSORT:Hibernation (Computing) Operating system technology Energy conservation Windows administration