How to view memory allocation stacktrace in Java V

2020-02-10 12:39发布

This article describes how to view memory allocation stacktrace in Java VisualVM: http://rejeev.blogspot.de/2009/04/analyzing-memory-leak-in-java.html

In short, define a custom preset in the Java VisualVM options and check the "record allocations stack traces" checkbox in the memory settings tab.

Now, when I select that custom preset and start memory profiling, I still cannot view the memory allocation stacktrace. There is no right-click-on-item action "Take snapshot and show allocation stack traces" as described in the article, nor a anything like that. I am using VisualVM 1.7.

How can I view these allocation stack traces?

2条回答
放荡不羁爱自由
2楼-- · 2020-02-10 13:24

If you can't see this option, go to Profiler -> activate "Settings" check box and activate "Record allocation stack traces" while the profiler is not active.

查看更多
The star\"
3楼-- · 2020-02-10 13:30

Enable Memory profiling in Sampler tab, then press a Heap Dump button.

查看更多
登录 后发表回答