Each time a method is called, a stack frame is created and pushed on to the thread's stack. The stack frame contains, at a minimum, the method's local variables and the method arguments. You can get a java.lang.StackOverflowError exception if you reach the maximum allowable stack limit of a thread. This can happen if:
You can set the -Xss option to increase the maximum stack size per thread.