RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong [v4]

Yi Yang yyang at openjdk.org
Fri Jun 17 07:02:47 UTC 2022


> It seems that calculation of MemoryMXBean.getNonHeapMemoryUsage(jmm_GetMemoryUsage) is wrong.
> 
> Currently, `NonHeapUsage=CodeCache+Metaspace(ClassTypeSpace+NonClassTypeSpace)+CompressedClassSpace(ClassTypeSpace)`
> 
> ==> CodeHeap 'non-nmethods' 1532544 (Used)
> ==> CodeHeap 'profiled nmethods' 0
> ==> CodeHeap 'non-profiled nmethods' 13952
> ==> Metaspace 506696
> ==> Compressed Class Space 43312
> init = 7667712(7488K) used = 2096504(2047K) committed = 8454144(8256K) max = -1(-1K)
> 
> In this way, getNonHeapMemoryUsage is larger than it ought to be, it should be `NonHeapUsage = CodeCache + Metaspace`.

Yi Yang has updated the pull request incrementally with one additional commit since the last revision:

  address Ioi's comments; fix LowMemoryTest2.sh failure

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/8831/files
  - new: https://git.openjdk.org/jdk/pull/8831/files/54318474..c3f02b8f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=8831&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8831&range=02-03

  Stats: 29 lines in 5 files changed: 10 ins; 16 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/8831.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/8831/head:pull/8831

PR: https://git.openjdk.org/jdk/pull/8831


More information about the serviceability-dev mailing list