Why are start-up times faster on Windows 8? [closed]
From the Building Windows 8 blog:
Now here’s the key difference for Windows 8: as in Windows 7, we close the user sessions, but instead of closing the kernel session, we hibernate it. Compared to a full hibernate, which includes a lot of memory pages in use by apps, session 0 hibernation data is much smaller, which takes substantially less time to write to disk. If you’re not familiar with hibernation, we’re effectively saving the system state and memory contents to a file on disk (hiberfil.sys) and then reading that back in on resume and restoring contents back to memory. Using this technique with boot gives us a significant advantage for boot times, since reading the hiberfile in and reinitializing drivers is much faster on most systems (30-70% faster on most systems we’ve tested).
It’s faster because resuming the hibernated system session is comparatively less work than doing a full system initialization, but it’s also faster because we added a new multi-phase resume capability, which is able to use all of the cores in a multi-core system in parallel, to split the work of reading from the hiberfile and decompressing the contents. For those of you who prefer hibernating, this also results in faster resumes from hibernate as well.
It’s probably worth mentioning quickly how we treat the hiberfile—if you read this and immediately went and did a dir /s /ah hiberfile.sys you would have found that it’s a pretty big file on disk. The hiberfile is sized by default at 75% of physical RAM. The file is essentially a reservation for hibernation data that will be written out as the system is dropping into hibernation. Typically much less space is actually used, and in the case of our fast startup usage, it’s typically ~10-15% of physical RAM but varies based on drivers, services, and other factors. The system also treats the hiberfile slightly differently than other files on disk, for example, the Volume Snapshot service ignores it (a small performance benefit.) You can disable hibernation and reclaim this space by running powercfg /hibernate off from an elevated command prompt. But be aware that if you do this, it will disable hibernation completely, including some nice capabilities like fast startup as well as hybrid sleep, which allows desktop systems to do both a sleep and hibernate simultaneously so if a power loss occurs you can still resume from the hibernated state. You can also run powercfg /hibernate /size and specify a value between 0 and 100 for the percentage of physical RAM to reserve for the hiberfile – but be careful! Specifying too small a size can cause hibernation to fail. In general, I recommend leaving it enabled at the default value unless you’re working on a system with extremely limited disk space.
Short answer, and in my own words is that your PC has sessions, session 0 is reserved for the kernel or console session and session 1 is normally the logged on users session. What they have done is take the hibernate feature we have had in Windows for years, which hibernates all sessions and they have modified it so it hibernates only session 0 (the kernel) . It goes like this:
- You click shutdown
- Your PC closes session 1 (your user session) and writes session 0 into the hiberfil.sys file on your hard drive.
- When you boot up your PC it reads the contents of session 0 from the hiberfil.sys file and pages it back into memory. It then initializes a new session for you.
To answer your second question, since this is modification to the kernel this cannot be done on Windows 7.
Out of interest, you can do a full (classic) shutdown by using shutdown.exe from command prompt.
shutdown /s /t 0
If you want to do a hybrid shutdown you can use:
shutdown /s /hybrid /t 0