Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk18u Public archive

Commit

Permalink
8276819: javax/print/PrintServiceLookup/FlushCustomClassLoader.java f…
Browse files Browse the repository at this point in the history
…ails to free

Backport-of: 7c2c58587d4eda5523331eae45e7d897252dc097
  • Loading branch information
mrserb committed Feb 17, 2022
1 parent 09dfa48 commit 525f17f
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
* @test
* @bug 8273831
* @summary Tests custom class loader cleanup
* @library /javax/swing/regtesthelpers
* @build Util
* @run main/timeout=60/othervm -mx32m FlushCustomClassLoader
*/
public final class FlushCustomClassLoader {

Expand All @@ -42,12 +45,8 @@ public static void main(String[] args) throws Exception {

int attempt = 0;
while (loader.get() != null) {
if (++attempt > 10) {
throw new RuntimeException("Too many attempts: " + attempt);
}
System.gc();
Thread.sleep(1000);
System.out.println("Not freed, attempt: " + attempt);
Util.generateOOME();
System.out.println("Not freed, attempt: " + attempt++);
}
}

Expand Down

1 comment on commit 525f17f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.