Performance - Windows application heap usage

less than 1 minute read

The following script will show how to profile the heap memory usage of Windows application with Windows Performance Toolkits

1
2
3
4
5
6
7
8
9
10
11
12
@echo off
xperf -on PROC_THREAD+LOADER+VIRT_ALLOC -stackwalk VirtualAlloc+VirtualFree -BufferSize 1024 -MinBuffers 512 -MaxBuffers 512 -stackwalk VirtualAlloc
xperf -start HeapSession -heap -Pids %1 -BufferSize 1024 -MinBuffers 512 -MaxBuffers 512 -stackwalk HeapAlloc+HeapRealloc
echo.
echo Performance Trace started.
echo.
echo When done with profile actions, 
pause 
echo Generating the report. 
xperf -stop HeapSession -stop -d heapUsage.etl
echo.
start xperfview heapUsage.etl