IIS (Internet Information Services) · Advanced Operations

Crash and Hang Diagnostics

When an application pool keeps crashing or the site freezes, a memory dump of w3wp.exe usually shows exactly which code is at fault.

Advanced 5 min Lesson 42 of 45Covers IIS 10 on Windows Server 2019/2022/2025 and Windows 10/11.
0/45 in IIS
On this page · 5 min · Advanced

Learning objectives#

  • Find crash evidence in Event Viewer
  • Capture a crash dump
  • Capture a hang dump
  • Analyse dumps with DebugDiag

Explanation#

Crashes leave traces: Event Viewer → Windows Logs → System, source WAS (event 5011 “A process serving application pool ‘ShopPool’ suffered a fatal communication error”), and Application log event 1000 (Application Error, w3wp.exe, faulting module).

Crash dump: run ProcDump (Sysinternals) attached to the w3wp.exe process with -e to write a full dump when an unhandled exception kills it, or create a Crash rule in DebugDiag Collection for the application pool.

Hang dump: while the site is frozen (requests piling up in Worker Processes → View Current Requests), take two or three dumps 30 seconds apart with procdump -ma.

Open the dumps in DebugDiag Analysis (CrashHangAnalysis) for a readable report — the threads, the exception and the call stacks — or in Visual Studio / WinDbg. For ASP.NET Core, dotnet-dump works too.

Step-by-step screens#

Drawings of IIS Manager in IIS 10 (Windows Server 2019/2022, Windows 10/11). The red numbers match the numbered actions under each picture; names on your computer will differ.

Loading pictures…

Code example: Capture crash and hang dumps with ProcDump#

PowerShellCapture crash and hang dumps with ProcDump Illustrative
# Which w3wp belongs to ShopPool?
& "$env:windir\system32\inetsrv\appcmd.exe" list wp


# Crash: wait for the process to die from an unhandled exception
procdump64.exe -accepteula -ma -e 5324 C:\dumps\


# Hang: three full dumps, 30 seconds apart
procdump64.exe -accepteula -ma -n 3 -s 30 5324 C:\dumps\
Expected output
WP "5324" (applicationPool:ShopPool)
[10:42:18] Exception: E0434352.CLR
[10:42:18] Unhandled: E0434352.CLR
[10:42:19] Dump 1 initiated: C:\dumps\w3wp.exe_261126_104218.dmp
[10:42:22] Dump 1 complete: 1,412 MB written in 3.1 seconds

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. appcmd list wp maps process IDs to pools.
  2. -e writes a dump on an unhandled exception.
  3. -ma means a full memory dump.
  4. -n 3 -s 30 takes three dumps 30 seconds apart for a hang.

Real-world use case#

ShopPool stopped twice a day (rapid-fail protection). A crash dump showed a stack overflow in a recursive pricing method; the fix took ten minutes once the stack was visible.

Common mistakes#

Restarting first, investigating later

Recycling destroys the evidence. Take a hang dump before restarting.

Dumps on the system drive

Full dumps are as large as the process memory. Write them to a data drive with free space.

Best practices#

  • Check WAS and Application events first
  • Full dumps (-ma)
  • Several dumps for hangs
  • Store and share dumps securely — they contain data

Remember this#

WAS 5011 = worker process crashed.

procdump -ma -e PID = crash dump.

Hang: several dumps 30 s apart.

Practice exercise#

Your task: Take two full dumps 20 seconds apart of process 4180 into D:\dumps.

Show solution
PowerShell Illustrative
procdump64.exe -accepteula -ma -n 2 -s 20 4180 D:\dumps\

Mini quiz#

Crash and Hang Diagnostics quizMultiple choice Question 1 of 1

Why take several dumps for a hang?

Score so far: 0/0

Want more? Practise all IIS MCQs · IIS interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.