Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get jmap histogram programmatically?

I would like to get the equivalent of the ouput of jmap -histo programmatically, from inside the monitored application. I see triggering a heap dump is possible through the HotSpot diagnostic bean, but I can't see how to get the histogram data. Is it possible ?

like image 913
nicoulaj Avatar asked Feb 23 '12 16:02

nicoulaj


1 Answers

It may be not the best example/code, but have a look at this

(I think it's only working on Hotspot JVMs)

like image 71
MRalwasser Avatar answered Oct 30 '22 19:10

MRalwasser