Bug: humongous arrays allocations OOMEs
Aleksey Shipilev
shade at redhat.com
Tue Nov 29 10:03:50 UTC 2016
Hi,
A very simple test:
public class Alloc {
static final int SIZE = Integer.getInteger("size", 1_000_000);
static Object sink;
public static void main(String... args) throws Exception {
for (int c = 0; c < 1000000; c++) {
sink = new int[SIZE];
}
}
}
OOMEs after some critical array size:
$ java -XX:+UseShenandoahGC -Dsize=1 Alloc
<OK>
$ java -XX:+UseShenandoahGC -Dsize=1000 Alloc
<OK>
$ java -XX:+UseShenandoahGC -Dsize=1000000 Alloc
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at Alloc.main(Alloc.java:12)
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list