RFR: JDK-8176520: Improve the accuracy of the instance size in hprof heap dumps [v2]

Alex Menkov amenkov at openjdk.org
Fri Feb 16 01:25:53 UTC 2024


On Thu, 15 Feb 2024 13:15:51 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> When I proposed this change 10 years ago, there was a push back: https://bugs.openjdk.org/browse/JDK-8005604.
> 
> Is it resolved now?

Thank you for the link @shipilev.
I've read the discussion, my understanding that main concern was the change can break external hprof parsers.
First of all, the change does not change hprof format.
"Instance size" field in HPROF_GC_CLASS_DUMP recors is not required for parsing classes or objects, it's needed only for analysis (search for leak suspects, etc.)
And "actual" size of objects in the heap is quite important for the analysis.
I looked at the code of 2 popular open-source hprof parsers/analyzers: VisualVM and Eclipse Memory Analyzer.
Both do not rely on the class instance size value from hprof file, but try to calculate (guess) it using knowledge about JVM internals.
Note also that this enhancement request came from VisualVM maintainer.
So I think it's a desired change with low risk of affecting hprof consumers.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17855#issuecomment-1947598443


More information about the serviceability-dev mailing list