-
Download and install debugging tools for Windows from here MS Debugging Tools Install 64 bit version if you're on 64 bit Windows and 32 bit version otherwise.
-
Change the
PATHenvironment variable to include bin directory of Debugging tools. On my system, I addedC:\Program Files\Debugging Tools for Windows 64-bitto thePATH. -
Instruct OS to collect allocation stack for mysqld with
gflags -i mysqld.exe +ust. On Vista and later, this should be done in "elevated" command prompt, it requires admin privileges.Now collect the leak information. The mode of operation is that: take the heap snapshot once, and after some load take it once again. Compare snapshots and output leak info.
-
Preparation : setup debug symbol path. In the command prompt window, do
set _NT_SYMBOL_PATH= srv*C:\websymbols*http://msdl.microsoft.com/download/symbols;G:\bzr\mysql-6.0\sql\DebugAdjust second path component for your needs, it should include directory where mysqld.exe is.
- Start mysqld and run it for some minutes
-
Take first heap snapshot
Where -p: actually, PID of my mysqld was 6768.umdh -p:6768 -f:dump1 - Let mysqld run for another some minutes
-
Take second heap snapshot
umdh -p:6768 -f:dump2 -
Compare snapshots
umdh -v dump1 dump2 > dump.compare.txt - Examine the result output file. It is human readable, but all numbers are in hex, to scare everyone except geeks.
-
gflags -i mysqld.exe -ustInstruct OS not to collect mysqld user mode stacks for allocations anymore.
