Recording for Heap Analysis
Windows Performance Recorder (WPR) enables heap analysis for all processes on the system.
To enable heap tracing for a desktop app
(Using WPRUI.exe)
From the More options dropdown menu, select the Heap usage profile.
Add a registry entry for the process by running the following command from an elevated command prompt window, replacing
<process_name>
with the name of the process to be traced:reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<process_name>" /v TracingFlags /t REG_DWORD /d 1 /f
(Using Wpr.exe)
Enable Heap tracking by setting the IFEO registry
wpr.exe -HeapTracingConfig <process_name> enable
Start the tracing session:
wpr.exe -start Heap [-filemode]
test the scenario.
Stop the tracing session:
wpr.exe -stop <file_name>
Disable Heap tracking
wpr.exe -HeapTracingConfig <process_name> disable
To enable heap tracing for a Microsoft Store app
From the More options dropdown menu, select the Heap usage profile.
If you want to trace a packaged application that is hosted in a process (such as WWAHost.exe), add a registry entry for the process by running the following command from an elevated command prompt window, replacing <process_name>, <package full name>, and <package-relative app ID> with your app information:
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<process_name>\<package full name>!<package-relative app ID>" /v TracingFlags /t REG_DWORD /d 1 /f
Note This combination (package full name + app ID) is not an app user model ID (package family name + app ID). The IFEO processing routines use the full name so that they can apply different behavior to different versions of a single package/app.