1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* SI 413 Fall 2012
 * Program to allocate a bunch of big arrays in Java
 */
 
class TestAlloc {
  public static void main(String[] args) {
    if (args.length != 1) {
      System.out.println("Need size");
      System.exit(1);
    }
 
    int size = Integer.valueOf(args[0]);
 
    int[] arr;
 
    for (int i=0; ; ++i) {
      System.out.println(i);
      arr = new int[size];
    }
  }
}