简体   繁体   中英

How to find memory leaks using VisualVM 1.3.6?

I am following this tutorial to find memory leaks. I did all the following steps (on page 6) and the results are as following. The problem is that I am not sure if this result are good or not and if there is any memory leak how to solve it?

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

In next page tutorial asks to run heap dump (page 7) which I did and the results for char[] are as following

结果2

Memory Analyzer (MAT) is more better.

First use you need dump the JVM heap: jmap -dump:format=b,file=<file> <pid>

Then open the dump file using MAT.

After analyze, you can see a chart like this:

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

Below the chart, you can see the memroy leak report.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM