8041683: Catch OutOfMemoryError in BitLengthOverflow and DoubleValueOverflow
authorbpb
Tue, 29 Apr 2014 09:42:16 -0700
changeset 24128 36469eed1629
parent 24127 5d05d4c0de7f
child 24129 23131cd76ca3
8041683: Catch OutOfMemoryError in BitLengthOverflow and DoubleValueOverflow Summary: java/math/BigInteger/BitLengthOverflow.java failing with OOME Reviewed-by: alanb
jdk/test/java/math/BigInteger/BitLengthOverflow.java
jdk/test/java/math/BigInteger/DoubleValueOverflow.java
--- a/jdk/test/java/math/BigInteger/BitLengthOverflow.java	Tue Apr 29 14:37:02 2014 +0200
+++ b/jdk/test/java/math/BigInteger/BitLengthOverflow.java	Tue Apr 29 09:42:16 2014 -0700
@@ -41,6 +41,10 @@
         } catch (ArithmeticException e) {
             // expected
             System.out.println("Overflow is reported by ArithmeticException, as expected");
+        } catch (OutOfMemoryError e) {
+            // possible
+            System.err.println("BitLengthOverflow skipped: OutOfMemoryError");
+            System.err.println("Run jtreg with -javaoption:-Xmx8g");
         }
     }
 }
--- a/jdk/test/java/math/BigInteger/DoubleValueOverflow.java	Tue Apr 29 14:37:02 2014 +0200
+++ b/jdk/test/java/math/BigInteger/DoubleValueOverflow.java	Tue Apr 29 09:42:16 2014 -0700
@@ -41,6 +41,10 @@
         } catch (ArithmeticException e) {
             // expected
             System.out.println("Overflow is reported by ArithmeticException, as expected");
+        } catch (OutOfMemoryError e) {
+            // possible
+            System.err.println("DoubleValueOverflow skipped: OutOfMemoryError");
+            System.err.println("Run jtreg with -javaoption:-Xmx8g");
         }
     }
 }