In Java, is there a way to know that a StackOverflow
error or OutOfMemory
exception may happen soon?
The OutOfMemory
exception m
Most StackOverflow errors come out of bad recursion. Unfortunately, the problem of determining if a recursion will stop is generally not decidable (this is a central concept in CS). There are cases, however, you could get warnings, for example some IDEs will let you know if you're invoking a function recursively with no parameters.