[xperf] 強制 xperf 在 event lost 的時候繼續分析 memory leak

[xperf] 強制 xperf 在 event lost 的時候繼續分析 memory leak

在 [xperf] 查 memory leak 初步 這篇中,寫到了如何用 xperf 來查 memory leak。

但有時候因為參數設定與設備的問題,Windows 可能沒辦法將所有的 event 都成功寫進 .etl 檔案裡面。

這時候,去分析這個檔案的話,很可能會遇到下面的訊息: 

xperf: warning: applying restriction of access for trace
processing 7872129 Events were lost in this trace. Data may be unreliable.
This is usually caused by insufficient disk bandwidth for ETW logging.
Please try increasing the minimum and maximum
number of buffers and/or the buffer size.
Doubling these values would be a good first attempt.
Please note, though, that this action increases the
amount of memory reserved for ETW buffers,
increasing memory pressure on your scenario.
See "xperf -help start" for the associated command line options.

 

這時候,如果在 command line 模式下,xperf 就不會繼續幫你分析了。

解決有幾個:

1. 修改 xperf -start 的參數,把 BufferSize, MaxBuffers 調大一點,可能會有用

2. 使用 -tle 參數,要求 xperf 即使發現有 event lost 的狀況,還是繼續處理

 
第二個方法修改後的命令如下:
 
xperf -i merge.etl -o stacks.txt -tle -symbols verbose dbghelplog -a heap -stacks so -top 25

 

加了 -tle 參數的話,xperf 會有警告訊息,不過就可以繼續分析了,

但資訊可能會較不足或是有誤喔!

(本頁面已被瀏覽過 308 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料