Stack overflow error

Hi all,

I'm developing an automata related software. Sometimes I get a "StackOverflow" error using a recursive method. I would like to change de JVM stack size using the Xss command, but I don't know how to do it. I also don't know wich size could be the best one. Which values could be reasonables to test?

Thanks

[336 byte] By [0zero7] at [2007-9-30 23:19:23]
# 1
If you are getting this with the standard stack size, you are recursing very deeply. Is that what is expected? You change can set the stack size with something like:java -Xss256M ...
dubwai at 2007-7-7 13:52:18 > top of Java-index,Other Topics,Algorithms...
# 2
You may also be interested in reading through this thread: http://forum.java.sun.com/thread.jspa?forumID=426&threadID=565073It may give you some ideas on how to de-recursify your algorithms.
RadcliffePike at 2007-7-7 13:52:18 > top of Java-index,Other Topics,Algorithms...
# 3

> Which values could be reasonables to test?

Start with twice as much as the default. If that's not enough, double it. Keep doubling until either it's enough or you decide that recursion is not the way to go.

Once you've found "big enough and then some," and assuming you decide to stick with recursion, then repeatedly bisect the difference between "too small" and "big enough and then some" until you find "just right."

Then you need to consider how many more iterations you might need "for real" than in this testing, if any, and adjust the size by some safety factor.

jverd at 2007-7-7 13:52:18 > top of Java-index,Other Topics,Algorithms...