Perhaps everyone knows that Windows, like other
operating systems, has a mode called “Sleep.” When activated, the computer
consumes a small amount of power, while it maintains the state of Windows on
the RAM, then turns off the device, and when it turns on, it transfers the
previous contents and restores them to the hard drive. Ramat. But did you know
that there are 6 different types of this "sleep" mode? Indeed, each
type consumes a different level of power consumption, so understanding the
mechanism by which this mode works is the first step towards saving power and
extending battery life for laptop users, so let us answer the following
question what happens when you put the computer into sleep mode (Sleep).
What happens when you activate sleep mode
Most of us notice the speed of rebooting and loading
the desktop with all its programs as it was after turning on the computer when
it was in sleep mode, but what happens when this feature is activated? Below is
what happens when you choose Sleep mode from the power options menu:
Turning off the computer screen: The speed of turning
off the screen varies according to the method used to enter the sleep mode, as
the screen goes to sleep mode after the predetermined time has passed if the
default settings method is used, but when the sleep mode is manually activated,
the screen turns off immediately.
● Turn off the power supply: It stops
sending power to various devices connected to the computer such as external
storage units, flash drives, and amplifiers.
● Save the computer's real-time state to the RAM:
Everything that is running on the computer at the time, such as websites,
applications, and open documents, is saved to the RAM, the random access memory
(RAM).
● Go to Low Power Mode: When programs, files, and all
devices and components connected to the computer stop working when the sleep
mode option is turned on, power consumption is significantly reduced as power
is disconnected from most of the computer components except for the RAM.
Microsoft has developed a sleep mode, and if the battery power drops
significantly, it will go to "Hibernate" mode, where the data
temporarily stored in the RAM is automatically transferred to the hard disk,
and then the computer is partially shut down so that it consumes the least
amount of power possible.
In general, as long as there is the power to the
computer/laptop (for example, the computer is still plugged in or the laptop
battery is still full) it will not lose the previous operating system state,
i.e. the programs and files that were open when it went into sleep mode so that
when Activate your computer again and you can pick up where you left off. This
was a quick simplification of what's going on, now let's dive in to understand
the idea!
ACPI and operating system
The ACPI (Advanced Configuration and Power Interface)
standard gives the BIOS and the operating system complete control over the
power sent to the internal hardware of the computer and defines operating modes
such as sleep, hibernate, shutdown or restart. The ACPI standard is not only in
names but at the level of actual energy consumption, that is, when the computer
is operating normally, it is at a high level of energy consumption, while when
activating a mode such as Sleep, it is in a medium energy consumption level
until you turn off the device completely and then there is no power consumption
according to the standard ACPI. These levels are called "ACPI states"
and are identified by the letter S followed by the level number from 0 to 5 as
shown below.
Level S0
Level S0 represents the actual working state of the
computer. At this level, every component of the computer, such as the processor
and graphics card, will perform all the required tasks without any restrictions
on its performance or energy consumption. Therefore, this mode is characterized
by fast performance, but on the other hand, its power consumption is maximum.
Levels S1 S2 S3 (Sleep)
The computer goes to sleep when ACPI takes one of the
levels S1, S2, or S3, which are known as low power consumption, but note that
most computers currently only support one of these three levels, but not all,
and most likely your computer supports only the third level S3 as the most
common. Before we go into each level, you can find out the supported sleep
state level on your device by executing the "powercfg /a" command in
the Windows CMD or PowerShell command as shown in the image above.
For the first level S1, the processor stops executing
any commands or instructions, but the electrical supply remains connected to
it, and then the power is disconnected from all unused devices, as well as the
storage units stop working while the RAM remains in a state of continuous
updating at this level. As for the second level, S2, the processor stops
consuming power completely and the feed continues to be connected to the RAM to
update it constantly in order to maintain the real-time state of the computer,
and at this level, the system is restored immediately upon user intervention
(either by moving the mouse or pressing any key from the keyboard).
While at the S3 level and the most common when the
“sleep” mode is activated, the power consumption from the power supply is
reduced to lower levels than S1 and S2 and the RAM continues to be updated and
fed with electricity, at this level some information is restored from the RAM
to the CPU and cache.
Level S4 (Hibernate)
The fourth level, ACPI S4, is the level for
"hibernation" in Windows where the computer appears to be idle and
power consumption is minimal. In this case, the computer keeps the contents of
its temporary memory in a file named (hiberfil.sys) and stores it in the
HDD/SSD to maintain the state of the system, i.e. the programs and files that
are currently open. Then most of the computer components stop working and
consuming power, including the RAM. To restart the computer after entering
"hibernation", it is enough to press the power button; The system
then reads the hiberfil.sys file on the hard drive and restores previously
opened programs and files. Therefore, the computer at level S4 takes longer to
reactivate compared to level S3.
Level S5 (Soft Off)
At level S5, Windows and all computer components
completely stop working, which translates to 0 power consumption, i.e. at this
level all open windows are closed without any information storage or storage.
This level also requires rebooting the computer again to get out of it, so when
you "Restart" from Windows, the computer automatically enters the S4
level before automatically restarting again, as well as when you press the
Shift button followed by Shut Down to shut down the computer completely because
The Shut Down option does not turn off the computer quite as well as you
might think.
It is worth noting that the S4 saves the sessions and
program data stored in RAM before the computer is turned off, which does not
allow temporary data to be lost. You also notice that the energy consumption is
maximum at the level S0 and then it decreases continuously, so the level S5 is
characterized as the lowest level of energy consumption.
How to enable sleep mode on your computer
Fortunately, there are several ways to enter a
computer sleep mode. Some devices allow them to enter sleep mode when the power
button is pressed once. You can also enter by going to the start menu, then
clicking on the power icon, and then choosing sleep mode. In the event that you
prefer to deal with shortcuts and find them faster, you can try pressing
Windows + X on the keyboard and then choose Shut Down or Sign Out, and then
Sleep, the operating system will go to sleep mode. The other way is to press
ALT + F4 and then choose computer sleep.
Make the right choice for you
Some people prefer to turn off their computers when they are done working on them. While others prefer to put their computers into sleep mode, there are other groups who prefer hibernation mode. All of these options are correct and will not harm your computer, but it is always preferable to choose the appropriate mode for you and your use.