mirror of
https://github.com/openjdk/jdk18u.git
synced 2025-12-10 16:28:08 -06:00
8276819: javax/print/PrintServiceLookup/FlushCustomClassLoader.java fails to free
Backport-of: 7c2c58587d4eda5523331eae45e7d897252dc097
This commit is contained in:
parent
09dfa48cda
commit
525f17fe15
@ -34,6 +34,9 @@ import javax.print.PrintServiceLookup;
|
||||
* @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 {
|
||||
|
||||
@ -42,12 +45,8 @@ public final class FlushCustomClassLoader {
|
||||
|
||||
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++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user