What happens if I "sleep" windows 10 while programs are running? [duplicate]

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


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