I am running a program written in Java in Eclipse. The program has a very deep recursion level for very large inputs. For small inputs, the program works fine, but when large inputs are given, I get the following error:
Exception in thread "main" java.lang.StackOverflowError
Can this be solved by increasing the size of the Java stack, and if so, how to do it in Eclipse?
Update:
@Jon Skeet
This code recursively traverses the parse tree to create a data structure. So, for example, the code will do some work using node in the parsing tree and call itself in node two children, combining their results to give a common result for the tree.
The overall depth of the recursion depends on the size of the parsing tree, but the code seems to fail (without a larger stack) when the number of recursive calls hits 1000.
I am also sure that the code does not fail due to an error, as it works for small inputs.
java eclipse stack-overflow jvm jvm-arguments
tree-hacker Jan 24 '10 at 13:35 2010-01-24 13:35
source share