RFR: 8013590: NPG: Add a memory pool MXBean for Metaspace

Erik Helin erik.helin at oracle.com
Tue May 28 16:22:27 UTC 2013


Hi all,

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.

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 hotspot-gc-dev mailing list