8221568: DataOutputStream/WriteUTF.java fails due to "OutOfMemoryError: Java heap space"
authorbpb
Wed, 27 Mar 2019 16:35:25 -0700
changeset 54316 f714e4cebceb
parent 54315 7d5a4a48e876
child 54317 5b5bd291ca32
8221568: DataOutputStream/WriteUTF.java fails due to "OutOfMemoryError: Java heap space" Reviewed-by: shade
test/jdk/java/io/DataOutputStream/WriteUTF.java
--- a/test/jdk/java/io/DataOutputStream/WriteUTF.java	Wed Mar 27 14:40:36 2019 -0700
+++ b/test/jdk/java/io/DataOutputStream/WriteUTF.java	Wed Mar 27 16:35:25 2019 -0700
@@ -24,7 +24,8 @@
 /* @test
  * @bug 4260284 8219196
  * @summary Test if DataOutputStream will overcount written field.
- * @run testng/othervm -Xmx2g WriteUTF
+ * @requires (sun.arch.data.model == "64" & os.maxMemory >= 3g)
+ * @run testng/othervm -Xmx3g WriteUTF
  */
 
 import java.io.ByteArrayOutputStream;
@@ -59,7 +60,7 @@
     }
 
     // Without 8219196 fix, throws ArrayIndexOutOfBoundsException instead of
-    // expected UTFDataFormatException. Requires 2GB of heap (-Xmx2g) to run
+    // expected UTFDataFormatException. Requires 3GB of heap (-Xmx3g) to run
     // without throwing an OutOfMemoryError.
     @Test(expectedExceptions = UTFDataFormatException.class)
     public void arrayIndexOutOfBoundsException() throws IOException {