剧集

碎片整理工具:#50 - WPT - 内存分析 - 堆

在碎片整理工具、安德鲁·理查兹、乍得·贝德和拉里·拉森的这一集中,继续引导你完成 Windows 性能工具包(WPT)。 这是关于内存使用情况/泄漏的 3 集的第 3 部分。 资源:Aaron Margosis VirtMemTest

时间线:
[00:00] - 碎片整理工具的第 50 集
[01:20] - 附加: xperf -start HeapSession -heap -pids %1 -stackwalk ...
[03:28] - VirtMemTest
[04:54] - WPA
[06:22] - 类型 - 分配的内部 (AI) 和外部 (AO), 释放内部 (FI) 和外部 (FO)
[07:20] - 启动:图像文件执行选项
[07:51] - Launch: xperf -start HeapSession -heap -pids 0 -stackwalk ...
[08:40] - 注册表编辑器 - IFEO
[10:26] - WPA
[11:06] - 类型 - 分配的内部 (AI) 和外部 (AO), 释放内部 (FI) 和外部 (FO)
[11:25] - 摘要 - AIFO

示例:“xperf - Collect Heap_Attach.cmd”

@echo off
回显 当准备好启动时按键...
pause

回波。
回波。。。捕获。。。
回波。

xperf -on PROC_THREAD+LOADER+VIRT_ALLOC -stackwalk VirtualAlloc+VirtualFree -BufferSize 1024 -MinBuffers 256 -MaxBuffers 256 -MaxFile 256 -FileMode Circular
xperf -start HeapSession -heap -pids %1 -stackwalk HeapAlloc+HeapRealloc -BufferSize 1024 -MinBuffers 256 -MaxBuffers 256 -MaxFile 256 -FileMode Circular

回显 当你想要停止时按键...
pause
回波。
回波。。。停止。。。
回波。

xperf -stop -stop HeapSession -d heap.etl

示例:“xperf - Collect Heap_Launch.cmd”

@echo off
回显 当准备好启动时按键...
pause

回波。
回波。。。捕获。。。
回波。

rem 将进程添加到 IFEO
reg add “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\%1.exe” /v TracingFlags /t REG_DWORD /d 1 /f

xperf -on PROC_THREAD+LOADER+VIRT_ALLOC -BufferSize 1024 -MinBuffers 256 -MaxBuffers 256 -stackwalk VirtualAlloc
xperf -start HeapSession -heap -pids 0 -stackwalk HeapAlloc+HeapRealloc -BufferSize 1024 -MinBuffers 256 -MaxBuffers 256 -MaxFile 256 -FileMode Circular

回显 当你想要停止时按键...
pause
回波。
回波。。。停止。。。
回波。

xperf -stop HeapSession -stop -d heap.etl

rem 从 IFEO 中删除进程
reg delete “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\%1.exe” /v TracingFlags /f