Last active
May 25, 2023 12:22
-
-
Save nickfloyd/a332462f85ac32372c74 to your computer and use it in GitHub Desktop.
windbg commands for finding memory leaks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: | |
http://blogs.msdn.com/b/paullou/archive/2011/06/28/debugging-managed-code-memory-leak-with-memory-dump-using-windbg.aspx | |
#Set symbols File >> Symbol File path | |
SRV*c:\symbols*http://msdl.microsoft.com/download/symbols | |
.reload | |
.loadby sos clr or .loadby sos mscorwks! | |
#optional | |
!VerifyHeap | |
#Find largest GC Heapsize - leak is possible if > 1gb or so | |
!EEHeap | |
#Find type with the largest size | |
!dumpheap -stat | |
#put type here - find type with the largest size | |
!dumpheap -type [TYPE] | |
#put largest result here | |
!do [ADDRESS] | |
#Loop above as needed, this is where it gets a bit fuzzy. Look for repeating patterns and high threads | |
#get a count of thread on the thing. Find a high thread count | |
!threads | |
#Pick a thread to look at it's stack - alternatively you can rum ~*kb for all thread stacks | |
~[THREAD ID]s | |
#show the stack | |
Kb | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment