Java stack overflow error - how to increase the stack size in Eclipse?
Open the Run Configuration for your application (Run/Run Configurations..., then look for the applications entry in 'Java application').
The arguments tab has a text box Vm arguments, enter -Xss1m
(or a bigger parameter for the maximum stack size). The default value is 512 kByte (SUN JDK 1.5 - don't know if it varies between vendors and versions).
How to increase stack size to allow more recursion?
Your error is indeed a StackOverflow caused by too much recursion, but Processing covers that up with the strange error you're seeing. Documentation on that bug is here.
You can increase the Java stack size to increase the limit of recursive calls. Info can be found here, but the gist is that you have to pass the -Xss setting into Java at runtime.
However, that setting requires that you run your sketch as a Java application. This is possible, but it involves exporting your sketch as a jar, then running the jar via the command prompt, or switching to eclipse. That's a lot more work than simply hitting the run button in Processing- and any users you send your jar would have to do the same.
Instead, you should probably refactor your algorithm to eliminate the excessive recursion.
How to increase the Java stack size?
Hmm... it works for me and with far less than 999MB of stack:
> java -Xss4m Test
0
(Windows JDK 7, build 17.0-b05 client VM, and Linux JDK 6 - same version information as you posted)
Increase stack size in ECLiPSe/prolog/fd
First, from error message text I'm assuming that you mean ECLiPSe constraint logic programming system, not Eclipse IDE.
Second, how do you start ECLiPSe? How do you load your code into ECLiPSe?
Try this (you said you are on Windows):
- Open command line from the folder where your ECLiPSe source file (say, 'myprogram.ecl') exists. For instructions look at this page: http://www.techsupportalert.com/content/how-open-windows-command-prompt-any-folder.htm
- In the command line put
eclipse -g 512000
and press ENTER. - Load your program using
[myprogram].
(put name of your ECLiPSe source file instead of 'myprogram'). - Execute queries as usual.
But I suspect that your program just runs forever and eats all memory, so all this probably won't help in the end.
EDIT. Updated instructions for TkECLiPSe:
- In TkECLiPSe in menu choose Tools -> TkECLiPSe Preference Editor.
- In preference window find option "Global/trail stack size (in megabytes)" and set it to 512.
- Save preferences and close TkECLiPSe.
- Next time you run TkECLiPSe stack size will be set to 512 Mb.
Related Topics
Best Way to Compare Dates in Android
Android - Change App Theme on Onclick
Android/Java -- Post Simple Text to Facebook Wall
Android: How to Change the Color of the Datepicker Divider
How to Add a Shadow and a Border on Circular Imageview Android
Keep Broadcast Receiver Running After Application Is Closed
Android.Util.Androidruntimeexception: Requestfeature() Must Be Called Before Adding Content
Javax.* Cannot Be Imported in My Android App
Why I Cant Use the Populateviewholder Override Method
How to View My Realm File in the Realm Browser
How to Connect via Https Using Jsoup
Ionic Build Android Error When Downloading Gradle
How to Set the Maximum Memory Usage for Jvm