Integrated: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
Aleksey Shipilev
shade at openjdk.java.net
Mon Oct 4 12:39:12 UTC 2021
On Thu, 30 Sep 2021 11:35:52 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> This reliably fails with Serial (ignored by @requires), Shenandoah and Z:
>
>
> $ CONF=linux-x86_64-server-fastdebug make run-test TEST=jdk/jfr/event/oldobject/TestClassLoaderLeak.java TEST_VM_OPTS="-XX:+UseShenandoahGC"
>
> ...
>
> STDERR:
> java.lang.RuntimeException: Could not find class leak
> at jdk.test.lib.Asserts.fail(Asserts.java:594)
> at jdk.jfr.event.oldobject.TestClassLoaderLeak.main(TestClassLoaderLeak.java:80)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:568)
> at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> at java.base/java.lang.Thread.run(Thread.java:833)
>
>
> I believe this test implicitly wants at least one GC cycle to happen so that `ObjectSampler::oop_storage_gc_notification` turns the sampled objects "old". An easy way to do this is to trim the Java heap size. If that does not work, we would need to go to MXBeans and watch GC cycles happening.
>
> Additional testing:
> - [x] Affected test with `-XX:+UseShenandoahGC`, 10 times
> - [x] Affected test with `-XX:+UseZGC`, 10 times
> - [x] Affected test with `-XX:+UseSerialGC`, 10 times
> - [x] Affected test with `-XX:+UseParallelGC`, 10 times
> - [x] Affected test with `-XX:+UseG1GC`, 10 times
This pull request has now been integrated.
Changeset: 47bfc8aa
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/47bfc8aa9367ff852ea5d901f1fa3c6ef316913e
Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
Reviewed-by: egahlin
-------------
PR: https://git.openjdk.java.net/jdk/pull/5775
More information about the hotspot-jfr-dev
mailing list