簡體   English   中英

如何使用VisualVM 1.3.6查找內存泄漏?

[英]How to find memory leaks using VisualVM 1.3.6?

我正在按照本教程來查找內存泄漏。 我執行了以下所有步驟(第6頁),結果如下。 問題是我不確定此結果是否良好,是否存在內存泄漏該如何解決?

The way of measuring is:
•(Switch off the automatic refreshing.)
•In Visual VM start the garbage collector, by pressing the corresponding icon.
•In Visual VM reset the results by pressing the “Reset collected results” icon. Now all
delta counters are reset.
•Perform your application procedure one or several times.
•In Visual VM press start the garbage collector again

結果1

在下一頁中,教程要求運行我所做的堆轉儲(第7頁),並且char []的結果如下

結果2

內存分析器(MAT)更好。

第一次使用時,您需要轉儲JVM堆: jmap -dump:format=b,file=<file> <pid>

然后使用MAT打開轉儲文件。

經過分析,您可以看到如下圖:

https://www.eclipse.org/mat/home/mat_thumb.png

在圖表下方,您可以看到內存泄漏報告。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM