changeset 9808:44fbb7e1a473

8041683: Catch OutOfMemoryError in BitLengthOverflow and DoubleValueOverflow Summary: java/math/BigInteger/BitLengthOverflow.java failing with OOME Reviewed-by: alanb
author bpb
date Tue, 29 Apr 2014 09:42:16 -0700
parents 276c2688450d
children 8c8bc4ac31a3
files test/java/math/BigInteger/BitLengthOverflow.java test/java/math/BigInteger/DoubleValueOverflow.java
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/math/BigInteger/BitLengthOverflow.java	Tue Apr 29 14:37:02 2014 +0200
+++ b/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/test/java/math/BigInteger/DoubleValueOverflow.java	Tue Apr 29 14:37:02 2014 +0200
+++ b/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");
         }
     }
 }