# HG changeset patch # User csahu # Date 1453974093 0 # Node ID 8c791dd1c24d85ebd18b03d49185c2a25263c129 # Parent 47cd96b2510f3dfefa27cf35559f724a26397581 8073735: [TEST_BUG] compiler/loopopts/CountedLoopProblem.java got OOME Summary: Ignore OOM in the test Reviewed-by: kvn diff -r 47cd96b2510f -r 8c791dd1c24d test/compiler/loopopts/CountedLoopProblem.java --- a/test/compiler/loopopts/CountedLoopProblem.java Wed Jan 27 15:01:46 2016 +0100 +++ b/test/compiler/loopopts/CountedLoopProblem.java Thu Jan 28 09:41:33 2016 +0000 @@ -36,18 +36,22 @@ public static void main(String[] args) throws Exception { Random r = new Random(42); int x = 0; - StringBuilder sb = new StringBuilder(); - for(int i = 0; i < 1000000; ++i) { - int v = Math.abs(r.nextInt()); - sb.append('+').append(v).append('\n'); - x += v; - // To trigger the problem we must OSR in the following loop - // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62 - while(x < 0) x += 1000000000; - sb.append('=').append(x).append('\n'); - } - if (sb.toString().hashCode() != 0xaba94591) { - throw new Exception("Unexpected result"); + try { + StringBuilder sb = new StringBuilder(); + for(int i = 0; i < 1000000; ++i) { + int v = Math.abs(r.nextInt()); + sb.append('+').append(v).append('\n'); + x += v; + // To trigger the problem we must OSR in the following loop + // To make the problem 100% reproducible run with -XX:-TieredCompilation -XX:OSROnlyBCI=62 + while(x < 0) x += 1000000000; + sb.append('=').append(x).append('\n'); + } + if (sb.toString().hashCode() != 0xaba94591) { + throw new Exception("Unexpected result"); + } + } catch(OutOfMemoryError e) { + // small heap, ignore } } }