RFR: 8315932: runtime/InvocationTests spend a lot of time on dependency verification

Thomas Stuefe stuefe at openjdk.org
Wed Oct 4 13:08:48 UTC 2023


On Fri, 8 Sep 2023 13:04:50 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Looking at performance of `runtime/InvocationTests` that run in `hotspot:tier3`, I notice that in `-Xcomp` tests, we are spending considerable time verifying nmethod dependencies, due to large number of generated classes. Normally, we would just add `-XX:-VerifyDependencies` to test that generates lots of classes, but I think this test actually wants to verify dependencies as part of the end-to-end invocation checks.
> 
> So, I think we can still mitigate the impact of dependency verification by making class unloading more frequent, so that stale classes would get unloaded often, and thus stop being considered by verification code as potential dependencies. One way is to trim down the metaspace size. (Maybe @tstuefe knows a better way to do this.)
> 
> Example improvements:
> 
> 
> $ time CONF=linux-x86_64-server-fastdebug make test TEST=runtime/InvocationTests/
> 
> # Before
>  4303.87s user 94.13s system 465% cpu 15:45.09 total
> 
> # After
>  2860.52s user 116.86s system 680% cpu 7:17.80 total
> 
> # (for the reference, disabling verification completely with -XX:-VerifyDependencies)
>  2284.49s user 84.64s system 605% cpu 6:31.30 total

Sorry, was off on PTO.

Not sure it works as intended though. Setting MaxMetaspaceSize does not expedite class unloading, it just makes class loading fail when that size is reached. It *may* have worked because setting MaxMetaspaceSize influences the metaspace GC threshold, so we do GCs earlier and clean up unused class loaders earlier. But that can be done directly with "MetaspaceSize=very small value, e.g. 1M". (notice the missing "Max")

Bad case would be the speedup you see came from the tests bailing out early because they hit and then hid Metaspace OOMs.

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

PR Comment: https://git.openjdk.org/jdk/pull/15637#issuecomment-1746840386


More information about the hotspot-runtime-dev mailing list