-
Bug
-
Resolution: Fixed
-
P4
-
8, 9
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8256910 | openjdk8u282 | Mandy Chung | P4 | Resolved | Fixed | b03 |
JDK-8231822 | 8u281 | Shivangi Gupta | P4 | Resolved | Fixed | b03 |
JDK-8257349 | emb-8u281 | Shivangi Gupta | P4 | Resolved | Fixed | team |
jdk/test/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java is a regression test created for
JDK-8151486: Class.forName causes memory leak
The test uses PhantomReferences to verify that instances of ClassLoader are garbage collected. The test works well, but fails if the -Xcomp VM flag is given:
----------System.out:(11/888)----------
returning phantom ref: java.lang.ref.PhantomReference@2f43ab0d to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@2ff14224 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@6bebaa4a to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@4006b63a to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@58140e41 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@745902d6 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@3597967c to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@ee64986 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@6ae29f7d to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@301bfb23 to LeakedClassLoader
Enqueued java.lang.ref.PhantomReference@3597967c
----------System.err:(13/897)----------
java.lang.RuntimeException: ClassLoader was never enqueued!
at ClassForNameLeak.main(ClassForNameLeak.java:114)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:537)
at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
at java.lang.Thread.run(java.base@9-internal/Thread.java:844)
The problem is well reproducible will any GC.
The test uses PhantomReferences to verify that instances of ClassLoader are garbage collected. The test works well, but fails if the -Xcomp VM flag is given:
----------System.out:(11/888)----------
returning phantom ref: java.lang.ref.PhantomReference@2f43ab0d to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@2ff14224 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@6bebaa4a to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@4006b63a to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@58140e41 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@745902d6 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@3597967c to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@ee64986 to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@6ae29f7d to LeakedClassLoader
returning phantom ref: java.lang.ref.PhantomReference@301bfb23 to LeakedClassLoader
Enqueued java.lang.ref.PhantomReference@3597967c
----------System.err:(13/897)----------
java.lang.RuntimeException: ClassLoader was never enqueued!
at ClassForNameLeak.main(ClassForNameLeak.java:114)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:537)
at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
at java.lang.Thread.run(java.base@9-internal/Thread.java:844)
The problem is well reproducible will any GC.
- backported by
-
JDK-8231822 jdk/test/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java fails with -Xcomp: ClassLoader was never enqueued!
- Resolved
-
JDK-8256910 jdk/test/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java fails with -Xcomp: ClassLoader was never enqueued!
- Resolved
-
JDK-8257349 jdk/test/java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java fails with -Xcomp: ClassLoader was never enqueued!
- Resolved
- duplicates
-
JDK-8169000 Define reference reachability more precisely in java.lang.ref package
- Closed
- relates to
-
JDK-8151486 Class.forName causes memory leak
- Closed