Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to execute dex: Java heap space Java heap space

I am getting Unable to execute dex: Java heap space Java heap space error while executing web driver script in Eclipse IDE. I have configured Eclipse IDE with Android SDK and AVD Manager.

I also increased the -Xms200m to -Xmx512m but it did not work.

like image 699
Atin Avatar asked Feb 21 '12 14:02

Atin


People also ask

How do I fix Java heap space in eclipse?

Temporary fix – Increase the heap size On the Eclipse menu, clicks Run -> Run Configurations.. , select the Java application we want to run, click on the Arguments tab, VM arguments section, and adjust a better Java initial maximum heap size.

How do you manage spaces in Java?

The simplest way to properly space your output in Java is by adding manual spacing. For instance, to output three different integers, "i," "j" and "k," with a space between each integer, use the following code: System. out.


3 Answers

The accepted solution to this post worked for me: Conversion to Dalvik format failed: Unable to execute dex: Java heap space

The gist is: Keep increasing the Xms and Xmx values until it either works or you run out of physical memory.

E.g.: -XX:MaxPermSize=1536m -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx1536m

like image 134
Mike Avatar answered Oct 11 '22 08:10

Mike


You said

I also increased the -Xms200m to -Xmx512m

-Xms200m and -Xmx512m are two different things. Maybe you wanted to say

from -Xms200m to -Xms512m

and

from -Xmx200m to -Xmx512m

like image 34
Joand Avatar answered Oct 11 '22 08:10

Joand


Change -Dosgi.requiredJavaVersion=1.5 to

-Dosgi.requiredJavaVersion=1.6

if your eclipse project is using java compiler 1.6. I just solved this problem.

like image 28
herbertD Avatar answered Oct 11 '22 09:10

herbertD