RFR: 8025226: TestPerfCountersAndMemoryPools.java fails with -Xmixed or -Xcomp

Erik Helin erik.helin at oracle.com
Mon Sep 30 08:36:21 PDT 2013

Hi all,

this change fixes the test
hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java which was
broken when running with -Xcomp or -Xmixed. The problem was that the
call to MemoryUsage.getUsed() triggered allocations of metadata. Since
the performance counters are only updated at the end of a GC, this
caused the performance counter and the memory pool for used metadata to
differ in how much they reported.

The solution is to only run the test in the interpreter by using -Xint.

I also added the tag @library tag which was missing from the test. The
test had never been run on "its own" before, the testlibrary had always
been compiled by another test before the test was run.

Finally, the test now only loops through the MemoryPoolMXBeans once to
find the correct memory pool.




More information about the hotspot-gc-dev mailing list