Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
525 views
in Technique[技术] by (71.8m points)

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:

ERROR: 'Java heap space'

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this

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

  -Xms512M -Xmx1524M

to the VM Arguments section

Few useful links

What are the best JVM settings for Eclipse?

Error "java heap size" in Eclipse Android?

Edit:

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

Run -> External Tools -> External Tool

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

Run in same JRE in workspace.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...