运行 Java 代码时 Eclipse 中出现 StackOverflowError
最近我遇到了一些内存问题,几天来我一直在尝试解决这些问题,但不幸的是没有任何运气!
我运行的是Mac OS X 10.6.8 / 8GB RAM(不应该有任何分配问题!)
Eclipse 版本是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)
我的 Java 异常:
Exception in thread "main" java.lang.StackOverflowError
还有我的 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
我也尝试将“-Xmx1536m”添加到 Eclipse 中的 VM 参数中,但根本没有任何运气!
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
StackOverflowError 是无限递归调用时的常见错误,例如:
这种调用将导致 StackOverflowError。
因此,如果您有这种类型的无限递归调用或可能是无限循环,您应该检查您的代码。
StackOverflowError is a common error when you have an infinite recursive call such as :
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.
在日食中
右键单击项目,按照以下步骤操作:
-Xss2g
默认情况下堆栈内存大小为 512 KB。我们可以根据需要增加。
如果有任何疑问,请在评论部分恢复评论。
In Eclipse
Right click on project follow below steps:
-Xss2g
By default stack memory size is 512 KB. We can increase as per our need.
If in case any query, revert comment in comment sections.