8159899: [TEST_BUG] Timeout in tests when OOM should be generated
Reviewed-by: yan, ssadetsky
--- a/jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/javax/swing/JOptionPane/6464022/bug6464022.java Tue Jul 26 15:55:22 2016 +0300
@@ -29,7 +29,7 @@
* @author Pavel Porvatov
* @library ../../regtesthelpers
* @build Util
- * @run main bug6464022
+ * @run main/othervm -mx128m bug6464022
*/
import javax.swing.*;
--- a/jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/javax/swing/UIDefaults/6795356/bug6795356.java Tue Jul 26 15:55:22 2016 +0300
@@ -28,7 +28,7 @@
* @author Alexander Potochkin
* @library ../../regtesthelpers
* @build Util
- * @run main bug6795356
+ * @run main/othervm -mx128m bug6795356
*/
import java.lang.ref.WeakReference;
--- a/jdk/test/javax/swing/regtesthelpers/Util.java Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java Tue Jul 26 15:55:22 2016 +0300
@@ -81,7 +81,8 @@
/**
* Fills the heap until OutOfMemoryError occurs. This method is useful for
- * WeakReferences removing.
+ * WeakReferences removing. To minimize the amount of filled memory the
+ * test should provide reasonable heap size via -mx option.
*/
public static void generateOOME() {
List<Object> bigLeak = new LinkedList<Object>();
--- a/jdk/test/sun/java2d/Disposer/TestDisposerLeak.java Tue Jul 26 14:54:26 2016 +0300
+++ b/jdk/test/sun/java2d/Disposer/TestDisposerLeak.java Tue Jul 26 15:55:22 2016 +0300
@@ -31,7 +31,7 @@
* @test
* @bug 8129457
* @summary Check Disposer disposes all objects without any memory leaks
- * @run main/othervm TestDisposerLeak
+ * @run main/othervm -mx128m TestDisposerLeak
* @modules java.desktop/sun.java2d
*/
public final class TestDisposerLeak {