Results 1 to 4 of 4
- 09-26-2008, 07:44 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 6
- Rep Power
- 0
increase stack size in eclipse for highly recursive method.
I'm running an algorithm which is highly recursive and I keep getting the
Exception in thread "main" java.lang.StackOverflowError
The code is correct, it has a return clause to break out, it is NOT recursing forever, it works perfectly if I call it via a loop.
I need to tell eclipse to increase the Stack size. I think you would normally do this via a command line parameter but I'm not running it from the cmd line i'm running it through eclipse. I can not find any option in the eclipse compile preferences for increasing the java stack size.
Does anybody know how to do this?
Thanks in advance
- 09-26-2008, 08:14 PM #2
How far does it go down before you run out of memory?
- 09-27-2008, 12:57 AM #3
Member
- Join Date
- Sep 2008
- Posts
- 6
- Rep Power
- 0
The number of times it recurses depends on the size of the file the method is run on.
It will work fine on small files when the number of recursions are low but fail when they go high. My method recursed on a large file 3197 times before the error was thrown.
In the method I am creating 2 local ints each time. Thats all. I even set the ints to class variables insted of local method variables but it makes no difference. The rest of the time I am just referencing private fields of the class. The method does not generate any new data it just deletes some text in a String of a private field in the class.
If I could just increase the stack in eclipse the problem would be solved but I can't find out where to do it.Last edited by Daedalus; 09-27-2008 at 12:59 AM.
- 09-27-2008, 04:46 AM #4
Similar Threads
-
How to set a stack size. -Xss doesn't work
By protonus in forum New To JavaReplies: 4Last Post: 06-27-2008, 06:59 PM -
exercise of recursive method
By amexudo in forum New To JavaReplies: 2Last Post: 03-09-2008, 05:55 PM -
Recursive Method ==> find minimum value from array
By NatNat in forum New To JavaReplies: 1Last Post: 02-16-2008, 09:10 PM -
gridbaglayout: increase/decrease size of components.
By newtojava7 in forum New To JavaReplies: 2Last Post: 01-28-2008, 07:22 AM -
Recursive Method
By bluegreen7hi in forum New To JavaReplies: 5Last Post: 11-29-2007, 04:45 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks