EMZETT.
Login

StackOverflowError (Java)

In short: The call stack is full, usually through a recursion without end.

In more detail: Every method call needs space on the stack.

In Depth

Possible causes

  • Recursion without a termination condition.
  • Mutual calls.

Solutions

  1. Add a termination condition.
  2. Replace recursion with a loop.
  3. Rarely: raise the stack size (-Xss).

See also: Java, Methoden