aragozin / jvm-tools

Small set of tools for JVM troublshooting, monitoring and profiling.
Apache License 2.0
3.32k stars 519 forks source link

feature request:relationship of objects on Java Heap #29

Open ismlsmile opened 7 years ago

ismlsmile commented 7 years ago

The reference relationship of objects on Java Heap is needed to debug memory leak

aragozin commented 7 years ago

Could you elaborate your request? Is it about heap dump parser library?

ismlsmile commented 7 years ago

The feature is something like Eclipse Memory Analyzer(https://www.eclipse.org/mat/about/screenshots.php). The hh(or jmap -histo)is just like this feature in Eclipse MAT: https://www.eclipse.org/mat/about/histogram.png

memory leak is not easy to debug according this picuture. But feature "Dominator Tree" and "Path to GC Roots" could help much to do this work: https://www.eclipse.org/mat/about/dominator_tree.png https://www.eclipse.org/mat/about/path_2_gc_roots.png

Eclipse MAT is offline, so sometimes it is not very convenient. And JProfiler has similar feautre and it is online, but it is commercial and GUI interface. So a online analyzer, CUI interface and open source implementation is very great.

geekpete commented 7 years ago

+1 for a CLI tool ability to do both offline and online would be awesome.

aragozin commented 7 years ago

I got the idea.

I working on CLI analyzer for heap dump files (offline version).

Concerning online, JProfiler probably exploits JVMTI to make it work. JVMTI would require non trivial C++ coding which I would like to avoid for number of reasons. I have few ideas how similar functionality can be implemented in pure Java, but I can promise to start work on this anytime soon.

ismlsmile commented 7 years ago

You are a great man !

aragozin commented 7 years ago

Oops. There was a typo, it should be "I can not promise to start work on this anytime soon". I'm sorry to disappoint you. But do not loose hope :)