7153375 "jmap -histo" should output a unique identifier with each line
rednaxelafx at gmail.com
Thu Mar 22 01:50:08 PDT 2012
This patch should work better after the work on Permanent Generation
removal is integrated into mainstream. For now, though, it's not guaranteed
to work: Klasses are subject to GC, which could move around from time to
You're using hashCode() from the Klass, whichi ultimately boils down to the
value of an address in the current implementation of SA. See  for
example. It may change from run to run if the object is moving.
It might have been better to use the identity hash code of the Java mirror
(the java.lang.Class instance) as the "identifier". Too bad, that doesn't
work with SA either; if the Java mirror was never hash'd, SA won't be able
to calculate its identity hash code -- which is the case most of the time.
On Thu, Mar 22, 2012 at 3:50 PM, Takao, Shinji
<takao.shinji at oss.ntt.co.jp>wrote:
> Dear all,
> As a trouble shooter of java programs, I have been examinig
> heap object histograms for tracking down memory leaks, and
> found an inconvenience in the histograms output by jmap (-F) -histo.
> Please see the CR 7153375 for details.
> And, I would like to show a quick fix for that.
> Please see the attached file (for openjdk8b27 hospot).
> I am not sure if it is the most appropriate way to fix that,
> however, I am glad if it will be a meaningful starting point.
> I am quite new to this ML, so I appreciate your assistance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the serviceability-dev