This issue has already been discussed at Stack overflows from deep recursion in Java?:
Increasing the stack size will only serve as a temporary bandage ... what you really want is tail call elimination, and Java does not have this for various reasons.