Windows 7 memory profiling example

less than 1 minute read


@echo off
set _NT_SYMBOL_PATH=F:\src\Release\;srv*c:\WebSymbol*http://msdl.microsoft.com/downloads/symbols

xperf -on base
xperf -start heapsession -heap -pids %1 -stackwalk HeapAlloc+HeapRealloc -BufferSize 512 -MinBuffers 128 -MaxBuffers 512

echo.
echo Performance Trace started.
echo.
echo When done with profile actions,

pause

xperf -stop heapsession -d heap.etl
xperf -d main.etl
xperf -merge main.etl heap.etl result.etl

echo.
start xperfview result.etl

usage: script.cmd [pid]