mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
make AwtListGarbageCollectionTest pass reliably
(cherry picked from commit 304eb7f919)
This commit is contained in:
committed by
alexey.ushakov@jetbrains.com
parent
3b6464043b
commit
133904610f
@@ -30,9 +30,8 @@
|
||||
*/
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.concurrent.locks.LockSupport;
|
||||
|
||||
public class AwtListGarbageCollectionTest {
|
||||
public static void main(String[] args) {
|
||||
@@ -57,6 +56,8 @@ public class AwtListGarbageCollectionTest {
|
||||
weakListRef = new WeakReference<List>(strongListRef);
|
||||
strongListRef = null;
|
||||
|
||||
LockSupport.parkNanos(1_000_000_000);
|
||||
|
||||
//make out of memory to force gc
|
||||
String veryLongString = new String(new char[100]);
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user