简体   繁体   English

eclipse与Android sdk,ERROR:Java堆空间

[英]eclipse with Android sdk, ERROR: Java heap space

So lately I'm having a problem while working in my apps inside eclipse the next message shows up while working with xml files: 最近我在使用eclipse中的应用程序时遇到问题,在处理xml文件时出现下一条消息:

ERROR: 'Java heap space'

I have read an try increasing inside the eclipse.ini file the: 我在eclipse.ini文件中读了一个尝试增加:

-vmargs
-Xmx40m
-Xmx512m

to: 至:

-vmargs
-Xmx512m
-Xmx1024m 

but it will work for a while than after and hour or so it will give me the same error, I'm working in a MacBook air with 4gb ram. 但它会工作一段时间而不是一小时左右它会给我同样的错误,我在4GB公羊的MacBook空气中工作。 I have Eclipse SDK Version: 3.7.2 Build id: M20120208-0800 and I just updated it, so I don't know if that is why is acting up this way, this is how my eclipse.ini looks right now: 我有Eclipse SDK版本:3.7.2构建ID:M20120208-0800我刚刚更新了它,所以我不知道这是为什么这样做的原因,这就是我的eclipse.ini现在的样子:

-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xmx512m
-Xmx1024m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

what else can I do to fix this? 我还能做些什么来解决这个问题? any help is really appreciated. 任何帮助真的很感激。 thanks in advance. 提前致谢。

Try this 试试这个

In Run->Run Configuration find the Name of the class you have been running, select it, click the Arguments tab then add: 在Run-> Run Configuration中,找到您正在运行的类的Name,选择它,单击Arguments选项卡,然后添加:

  -Xms512M -Xmx1524M

to the VM Arguments section 到VM Arguments部分

Few useful links 几个有用的链接

What are the best JVM settings for Eclipse? Eclipse的最佳JVM设置是什么?

Error "java heap size" in Eclipse Android? Eclipse Android中的“java堆大小”错误?

Edit: 编辑:

Your eclipse.ini settings will take effect only if you change following: 只有在更改以下内容后,您的eclipse.ini设置才会生效:

Run -> External Tools -> External Tool 运行 - >外部工具 - >外部工具

Configurations. 配置。 go to configuration that u use, under jre tab -select option 转到你使用的配置,在jre tab -select选项下

Run in same JRE in workspace. 在工作区中运行相同的JRE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM