Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274563

jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening

    XMLWordPrintable

Details

    • jfr
    • b18

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

                shade Aleksey Shipilev
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: