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 Performance Trace started. 
echo When done with profile actions, 


echo Generating the report. 

xperf -stop HeapSession -stop -d heapUsage.etl

start xperfview heapUsage.etl

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: Logo

You are commenting using your 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