This scenario guide explains how to troubleshoot issues where a system shutdown doesn't complete and stops responding. It also helps collect the data and start the analysis of the issue. For more information, see General information about the system shutdown.
The memory dump file
To troubleshoot this scenario, you need a Complete Memory Dump. If the machine has a lot of memory, you should configure an Active Memory Dump to reduce the size of the dump file. To get a memory dump, initiate a shutdown and wait 10 minutes for the dump analysis. Use the same method as for troubleshooting a computer that's in a frozen state to configure and create the memory.dmp file. The file is for analysis from a physical computer or a virtual machine.
Debugging tools
To analyze the memory dump file, install the Windows debugger.
The MEX Debugging Extension for WinDbg helps debug and analyze shutdown problems. It can also simplify common debugger tasks and provides powerful text filtering capabilities to the debugger.
Analysis preparation
Configure the Windows debugger with the symbol path so that the Windows debugger can load symbols to analyze the scenario.
Use a local folder (for example, c:\Symbols) to cache with the Microsoft symbol server. Set the Symbol path as follows:
Unzip the mex.zip file and copy the 64-bit version of mex.dll to the winext folder under the path of the installed debugger tools (for example, C:\Prgram Files (x86)\Windows Kits\10\Debuggers\x64\winext\mex.dll).
Start the debugger, load the memory.dmp file, and load the mex extension. For example:
0: kd> .load C:\Prgram Files (x86)\Windows Kits\10\Debuggers\x64\winext\mex.dll
Mex External 3.0.0.7172 Loaded!
Analyze with debuggers
You can analyze crash dump files with debuggers.
The possible causes that block the shutdown for hours are:
- Blocked kernel situations
- Services that don't end
- The policy to clear the paging file at shutdown is activated
Blocked kernel situations
Check for blocked threads by using the command !mex.tl -t. For example:
Services that don't end
To isolate a problem with third-party services, start the machine in safe mode with the third-party services disabled, and then shut it down with the third-party services disabled. If the problem is related to a third-party service, continue to use the System Configuration utility and selective startup to isolate the service blocking the shutdown.
Check the "ClearPageFileAtShutdown" value
Check the value data of the ClearPageFileAtShutdown value (Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management). If the value is 0, the policy to clear the paging file at shutdown is disabled. If the value is 1, the policy is enabled.
References
- Shutdown Processes Duration
- System Shutdown
- Complete Memory Dump
- Symbol path for Windows debuggers
- Windows-based computer freeze troubleshooting
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
