1. install .net 3.5 supported xperf (provide by law大) if you never updated in win7
* check your .net version by check c:\windows\microsoft.net\framework
2. run the test app init
3. save the following content to heap_trace.bat
-------------------------------
@echo off
if not @%1@ == @@ set pid=%1
xperf -on base
xperf -start userheap -heap -pids %pid% -stackwalk HeapAlloc+HeapRealloc+HeapFree+HeapDestroy -buffersize 512 -minbuffers 128 -maxbuffers 512
if not errorlevel 0 goto :eof
echo Performance Trace started.
echo When done with profile actions,
pause
echo.
xperf -stop userheap -d userheap.etl
xperf -d main.etl
xperf -merge main.etl userheap.etl merged.etl
if not errorlevel 0 goto :eof
-------------------------------
4. start command window then execute the “heap_trace.bat %pid you want to check%”
5. execute possible leak action
6. press enter on the window in 4.
7. select outstanding heap allocate window with possible time and get the summary table
7. check item with AIFO. (allocate inside free outside)
*other info: version: process life time/right click/ image summary table can check the image version you are running
* the symbol path need to set to view the stack show in summary table