In this example:
public class Testbed {
private static final int SIZE = 64;
public static void main(String[] args) throws Exception {
int limit = 10000;
run(limit);
}
private static void run(int limit) {
if (limit == 0) {
return;
}
for (int i = 0; i < 1000; i++) {
Object ints = new Object[SIZE];
run(limit - 1);
}
}
}
When running with -verbose:gc, why is it that SIZE=64 yields no GC whatsoever (i.e. the array is allocated on the stack), but SIZE=65 - does?
JVM is 7u79-2.5.5-0ubuntu1