问题
I would like to get the equivalent of the ouput of jmap -histo
programmatically, from inside the monitored application. I see triggering a binary heap dump is possible through the HotSpot diagnostic bean, but I can't see how to get the histogram data. Is it possible ?
回答1:
It may be not the best example/code, but have a look at this
(I think it's only working on Hotspot JVMs)
来源:https://stackoverflow.com/questions/9417038/how-to-get-jmap-histogram-programmatically