Performance – Windows application heap usage

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

@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

Advertisements
This entry was posted in Performance, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s