DO NOT DO THIS UNDER ANY SANE CIRCUMSTANCES!
public class Fail {
public void thisFails(int x){
System.out.println(x);
Integer[] bigArray = new Integer[9450];
thisFails(x+1);
}
public static void main(String[] args) {
Fail failure = new Fail();
failure.thisFails(1);
}
}
When this is ran using 1m of heap space (java -Xmx1m Fail) it will run out of heap at the 100th recursion.
...
I will now go wash my hands.