What does Windows 10 write to my drive before going to sleep?

14

4

I noticed that my Windows 10 laptop takes around 6 seconds to go to sleep, and during these six seconds the SSD's activity LED is on. I imagine that Windows is writing something on the SSD before going to sleep.

I remember my Linux systems going to sleep instantly when I pressed the sleep button, which makes me wonder if I can do the same on Windows.

Given that Hybrid Sleep is disabled, what does Windows do with my drive before sleeping, and is it necessary ?

Hey

Posted 2016-09-04T08:45:46.023

Reputation: 939

Linux going to sleep "instantly" sounds odd. Linux definatly goes to sleep faster on my laptop, but it still takes 2-3 seconds as opposed to windows' 6-12 – Blaine – 2017-01-07T18:42:01.143

1When I tested, I could hear the fans stop after <1 second. It surely depends on the distribution. Also note that I have a SSD. – Hey – 2017-01-07T19:40:18.470

Answers

12

I imagine that Windows is writing something on the SSD before going to sleep.

That is correct. If there is any data waiting in the disk's write cache, it must be written to the disk before the disk is powered off.

Note that disk caching can be disabled so that everything is written to the disk immediately. This ensures that data is not lost as a result of a power failure, but it does reduce performance.


Turn Disk Write Caching On or Off:

  1. Right-click My Computer, and then click Properties.
  2. Click the Hardware tab, and then click Device Manager.
  3. Expand Disk Drives.
  4. Right-click the drive on which you want to turn disk write caching on or off, and then click Properties.
  5. Click the Policies tab.
  6. Click to select or clear the Enable write caching on the disk check box as appropriate.
  7. Click OK.

enter image description here

Source HOW TO: Manually Turn Disk Write Caching On or Off

DavidPostill

Posted 2016-09-04T08:45:46.023

Reputation: 118 938

Nice answer. Are you using that High Contrast Theme to improve performance? Or is that XP? Or an old Answer? – Don't Root here plz... – 2016-09-04T13:26:32.350

2@Don'tRoothereplz... Windows 7 Classic Theme - I don't Like Aero :) – DavidPostill – 2016-09-04T13:28:57.667

Which makes me wonder about the Linux behaviour... Instant sleep? – UniversallyUniqueID – 2016-09-04T14:09:57.897

@BharadwajRaju Perhaps he has write caching turned off in Linux? – DavidPostill – 2016-09-04T14:11:31.877

@YdobEmos <shrug> No idea I don't run Linux. – DavidPostill – 2016-09-04T14:44:37.793

Disabling disk caches will cost you a lot of performance. This option is there for removable devices that aren't recognized as removable by the system, and is never needed for an SSD. – Simon Richter – 2016-09-04T16:34:24.320

@SimonRichter That doesn't affect the answer though. If it's not disabled then a write is required to flush the buffers before the disk is powered off. – DavidPostill – 2016-09-04T16:36:41.917

Flushing the buffers shouldn't take six whole seconds I would have thought. – DeadMG – 2016-09-04T19:12:23.260

@DeadMG My external USBs take a lot longer to flush and power off ... – DavidPostill – 2016-09-04T19:17:28.013

0

Before Windows goes to Sleep, it MUST write an image of the main storage to be able to come back after sleep in the exactly same state as it was when going to sleep. So When powering on after sleep state, Windows loads back the memory (instead of load every and each program again from zero) and show you exactly what was opened and on the screen before sleeping.

MisterVSE

Posted 2016-09-04T08:45:46.023

Reputation: 132

What "main storage" are you talking about ? Also, when sleeping, the system needs to stay powered to keep the RAM's content. I don't see why it should also make an image (if you were talking about RAM), ans I don't see the same activity at wakeup, when the system would read the RAM image. – Hey – 2016-09-14T15:14:35.410

Sorry, I understand in this post, sleeping as "Hybernating". That means, the computer goes Power Off. That said, the RAM (that I call Main Storage here, because of my Mainframe skills) will go off. Nonetheless, when you push the Power On button after going to Hybernation, you'll have the system back in the same state you've left when it went off. For that to happen, the contents of RAM (Main Storage) is saved on HD for quick restart. – MisterVSE – 2016-09-16T12:01:01.680

For best understanding, you can take a look on this article on "How-To_Geek" pages (they are great!) http://www.howtogeek.com/102897/whats-the-difference-between-sleep-and-hibernate-in-windows/ and sorry if I did undestand wrong your question.

– MisterVSE – 2016-09-16T12:06:50.867

0

To see what Windows is doing during sleep, install the Windows Performance Toolkit which is part of the Windows 10 SDK.

Now capture the activity during sleep, by running WPRUI.exe, select First Level, DiskIO, FileIO and under Performance Scenario select Standby/Resume. Number of iteration can be set to 1 and click to start. This suspends/resumes Windows and captures all activity.

enter image description here

After the resume, double click on the generated ETL file to open it with the Windows Performace Analyzer, load the debug symbols, click on "Profile"-> Apply, browse catalog and select the file standby.wpaprofile.

Drag & Drop the File I/O graph from Graph Explorer -> Storage to the analysis pane.

enter image description here

Select the part from the start before you see "Tracing off", do a rightclick, select zoom.

enter image description here

Now put the Column File Pathto the first position and here you can see which files/folders are accessed before Windows sleeps.

enter image description here

magicandre1981

Posted 2016-09-04T08:45:46.023

Reputation: 86 560

-1

The real answer is in the Power & Sleep settings Power Settings

user640728

Posted 2016-09-04T08:45:46.023

Reputation: 1