StackOverflowError in Eclipse while running Java code
11,104
StackOverflowError is a common error when you have an infinite recursive call such as :
void method(int a) {
method(a);
}
this kind of calls will lead to the StackOverflowError.
So you should check in your code if you have this type of infinite recursive calls or maybe an endless loop.
Author by
JavaCake
Updated on June 04, 2022Comments
-
JavaCake almost 2 years
Lately i ran into some memory issues which i have been trying to solve the paste few days, but unfortunately without any luck!
I am running Mac OS X 10.6.8 / 8GB RAM (Should not be any allocation problems!)
Eclipse version is Helios.
java -version java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
My Java exception:
Exception in thread "main" java.lang.StackOverflowError
And my eclipse.ini:
-startup ../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.0.v20100503 -product org.eclipse.epp.package.java.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 1G --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms256m -Xmx512m -XX:PermSize=1024m -XX:MaxPermSize=1024M -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
I have also tried to add "-Xmx1536m" to my VM arguments in Eclipse, but without any luck at all!
Thanks in advance.
-
JavaCake over 12 yearsI will step through my code once again. It just seems like an odd coincidence that my code compiles on my secondary machine without any exceptions. And i am indeed working with recursion.
-
Adel Boutros over 12 years@JavaCake Post your code and we can help you identify the endless recursive call maybe.