RFR: 8307958: Metaspace verification is slow causing extreme class unloading times [v2]
Axel Boldt-Christmas
aboldtch at openjdk.org
Mon May 22 15:59:04 UTC 2023
> From JBS:
>>We see very long class unloading times with Generational ZGC in fastdebug builds. MacOS spindumps show that it is caused by Metaspace verification code.
>>
>>I think the main problem is that many of the verification operations are performed at every operation (add, remove, split, merge) and the individual operation verifies much more than a constant number of chunks. This seems to give a quadratic complexity which blows up if you don't class unload often enough.
>
> The approach here is to resolve this by putting the verification behind the SOMETIMES macro. It is then possible to turn it of completely with `-XX:VerifyMetaspaceInterval=0` while still benefiting from some stochastic verification.
>
> The goal here is to have the calls to Verify unchanged. Leaving all explicit gtest verify and Universe::verify calls unaffected.
> The verification was also left unchanged when committing the memory.
>
> All SOMETIMES uses the same frequency, `VerifyMetaspaceInterval`. I looked at the possibility of adding weight to some of the call site, but it did not seem to be worth the complexity.
>
> Testing: GHA and Oracle CI (tier1-3 ongoing), various long running stress tests.
Axel Boldt-Christmas has updated the pull request incrementally with two additional commits since the last revision:
- Always verify gtests -XX:VerifyMetaspaceInterval=1
- Revert "Fix gtest"
This reverts commit 5991e03fde88d9262778ea460067139b38ed497a.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/14084/files
- new: https://git.openjdk.org/jdk/pull/14084/files/5991e03f..5f0cf5a8
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=14084&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=14084&range=00-01
Stats: 6 lines in 2 files changed: 0 ins; 4 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/14084.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14084/head:pull/14084
PR: https://git.openjdk.org/jdk/pull/14084
More information about the hotspot-runtime-dev
mailing list