RFR: 8013590: NPG: Add a memory pool MXBean for Metaspace
Erik Helin
erik.helin at oracle.com
Wed May 29 01:44:31 PDT 2013
Hi all,
this want sent to hotspot-gc-dev at openjdk.java.net, sending to
serviceability-dev at openjdk.java.net as well since the change is about
memory pools.
This change adds two memory pools for metaspace, one for Metaspace and
one for compressed klass space. The memory pool for compressed klass
space will only have valus that differ from 0 or -1 (undefined) if
compressed klass pointers are used.
Question: Should I use an empty pool when compressed klass pointers are
*not* used or should I just not expose the pool?
This change also adds a manager for the pools: Metaspace Manager.
I have also added a test that checks that the metaspace manager is
present and that the two pools are present. The test also verifies that
the compressed klass space pool act correct according to the
UseCompressedKlass flag.
The last time I added metaspace memory pools, it triggered some
unforeseen bugs:
- Two asserts in jmm_GetMemoryUsage that asserted that a memory pool was
either of heap type or had an undefined init/max size.
- The jdk/test/java/lang/management/MemoryMXBean/MemoryTest.java failed
- The service lock was taken out of order with the metaspace locks
These bugs have all been fixed:
- The asserts have been removed since they are no longer true
- The test has been updated but is not part of this change since it is a
JDK change
- This change does not make use of functions requiring the metaspace
lock. I had to remove some verification code in free_chunks_total to
ensure this.
Webrev:
http://cr.openjdk.java.net/~ehelin/8013590/webrev.00/
Testing:
- One new jtreg test
- JPRT
- All the tests that failed in nighly testing last time now pass
Thanks,
Erik
More information about the serviceability-dev
mailing list