On Tue, 14 Feb 2023 13:40:40 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:
> VM.classloader_stats shows metaspace consumption in words, but should show > bytes. > > Patch fixes that, and adjusts the associated jtreg test to catch regressions > like this. > > I manually tested the test with the unpatched hotspot to see if the > regression shows up, it does. > > Tested the patch on x64 (fastdebug, release) and x86. > > Note: "calculate_jfr_stats" is misnamed, actually only ever used by this > dcmd, not by jfr. I will clear this up in a separate RFE. So in addition to the poor name, the declaration is wrong: void calculate_jfr_stats(size_t* p_used_bytes, size_t* p_capacity_bytes) const; as it refers to bytes not words. Perhaps better to clean this up completely in this issue rather than a separate RFE? That said, given: // This only exists for JFR and jcmd VM.classloader_stats. We may want to // change this. Capacity as a stat is of questionable use since it may // contain committed and uncommitted areas. For now we do this to maintain // backward compatibility with JFR. and the fact this is not used by JFR then maybe it should all just be removed? ------------- PR: https://git.openjdk.org/jdk/pull/12556