RFR: JDK-8267348: Rewrite gc/epsilon/TestClasses.java to use Metaspace with less classes

Aleksey Shipilev shade at openjdk.java.net
Wed May 19 17:31:58 UTC 2021


See the bug report for discussion. The test verifies that Epsilon reacts on Metaspace resizes properly. It started to timeout since Vtable-based CHA implementation landed. The dependency checking walks a lot of classes looking at their oops, and this gets very slow with `+CheckUnhandledOops`. There are measures to improve `CheckUnhandledOops`, but we can also rewrite the test to puff up the same amount of Metaspace with less classes.

I have selected the new constants to match the same Metaspace occupancy like the original test (~25M). New code requires absorbing a few more allocations, so heap size is bumped to 1G, which is similar to other Epsilon tests.

Running with default options before:


[26.945s][info   ][gc          ] Heap: 128M reserved, 128M (100.00%) committed, 66524K (50.75%) used
[26.945s][info   ][gc,metaspace] Metaspace: 69632K reserved, 24896K (35.75%) committed, 24703K (35.48%) used

real	0m47.997s
user	1m18.188s
sys	0m4.365s


...and after:


[0.818s][info   ][gc          ] Heap: 1024M reserved, 1024M (100.00%) committed, 181M (17.68%) used
[0.818s][info   ][gc,metaspace] Metaspace: 86016K reserved, 25856K (30.06%) committed, 25732K (29.92%) used

real	0m19.919s
user	0m50.806s
sys	0m4.356s


Running with `-XX:+CheckUnhandledOops` before:


[394.089s][info   ][gc          ] Heap: 128M reserved, 128M (100.00%) committed, 52731K (40.23%) used
[394.089s][info   ][gc,metaspace] Metaspace: 69632K reserved, 19456K (27.94%) committed, 19267K (27.67%) used
...
<timeout>


...and after:


[1.952s][info   ][gc          ] Heap: 1024M reserved, 1024M (100.00%) committed, 180M (17.66%) used
[1.952s][info   ][gc,metaspace] Metaspace: 86016K reserved, 25856K (30.06%) committed, 25732K (29.92%) used

real	0m27.555s
user	0m57.851s
sys	0m4.645s


Additional testing:
 - [x] Affected test with `-XX:+CheckUnhandledOops`

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

Commit messages:
 - Adjust constants to match 25K
 - Make the test consume the same amount of metaspace, but using less classes
 - Remove from ProblemList

Changes: https://git.openjdk.java.net/jdk/pull/4118/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4118&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8267348
  Stats: 17 lines in 2 files changed: 12 ins; 1 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4118.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4118/head:pull/4118

PR: https://git.openjdk.java.net/jdk/pull/4118



More information about the hotspot-gc-dev mailing list