Eclipse 与 Android sdk,错误:Java 堆空间 [英] eclipse with Android sdk, ERROR: Java heap space

查看:47
本文介绍了Eclipse 与 Android sdk,错误:Java 堆空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我在 eclipse 中使用我的应用程序时遇到问题,在使用 xml 文件时显示下一条消息:

So lately I'm having a problem while working in my apps inside eclipse the next message shows up while working with xml files:

ERROR: 'Java heap space'

我在eclipse.ini文件中读到了一个尝试增加的内容:

I have read an try increasing inside the eclipse.ini file the:

-vmargs
-Xmx40m
-Xmx512m

到:

-vmargs
-Xmx512m
-Xmx1024m 

但它会工作一段时间,而不是一小时左右,它会给我同样的错误,我正在使用 4GB 内存的 MacBook air.我有开发工具包版本:3.7.2版本号:M20120208-0800我刚刚更新了它,所以我不知道这是否就是为什么会这样,这就是我的 eclipse.ini 现在的样子:

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. 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:

-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.

推荐答案

试试这个

在 Run->Run Configuration 中找到您一直运行的类的名称,选择它,单击 Arguments 选项卡,然后添加:

In Run->Run Configuration find the Name of the class you have been running, select it, click the Arguments tab then add:

  -Xms512M -Xmx1524M

到 VM 参数部分

一些有用的链接

Eclipse 的最佳 JVM 设置是什么?

错误java 堆大小"在 Eclipse Android 中?

您的 eclipse.ini 设置只有在您更改以下内容时才会生效:

Your eclipse.ini settings will take effect only if you change following:

运行 -> 外部工具 -> 外部工具

Run -> External Tools -> External Tool

配置.转到您使用的配置,在 jre 选项卡下 - 选择选项

Configurations. go to configuration that u use, under jre tab -select option

在工作区中的同一个 JRE 中运行.

Run in same JRE in workspace.

这篇关于Eclipse 与 Android sdk,错误:Java 堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆