E.g. following does lead to a stack overflow exception:
endless recursion - of course, this is the obvious reason
to many lines of code and/or functions - seems like functions are put on the stack and at some point the stack overflows
The second...