mahmud83 / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

OutOfMemory accoured in dex phase #458

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.mvn intall

What is the expected output?

I exptected to get the .apk

What do you see instead?

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded[INFO]

What version of maven-android-plugin are you using?
3.8.0

What are the complete output lines of "mvn -version" on your machine?

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 
2014-02-15T01:37:52+08:00)
Maven home: D:\Users\wlzhao\Downloads\apache-maven-3.2.1\bin\..
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_45\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Please provide any additional information below.
In My opinion. the oom accoured in dex phase. My Projection is very huge,so 
1024M is not enough.how can I config it? may be 2048M is ok.

who can help me? i will be very gratefull.

Following is original info.

[INFO] --- android-maven-plugin:3.8.0:emma (default-emma) @ view ---
[INFO] 
[INFO] --- android-maven-plugin:3.8.0:dex (default-dex) @ view ---
[INFO] C:\Program Files\Java\jdk1.6.0_45\jre\bin\java [-Xmx1024M, -jar, 
D:\Users\wlzhao\Downloads\adt-bundle-windows-x86_64-20140321\adt-bundle-windows-
x86_64-20140321\sdk\build-tools\android-4.4.2\lib\dx.jar, --dex,[jar list 
omitted]

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded[INFO] 

[INFO] UNEXPECTED TOP-LEVEL ERROR:
    at com.android.dx.ssa.Dominators$DFSInfo.<init>(Dominators.java:282)[INFO] java.lang.OutOfMemoryError: GC overhead limit exceeded

Original issue reported on code.google.com by com.aimo...@gmail.com on 25 Apr 2014 at 3:48

GoogleCodeExporter commented 9 years ago
You can provide any JVM arguments you want to dex.
See http://jayway.github.io/maven-android-plugin/dex-mojo.html

So just increase the available memory:
<dex>
  <jvmArguments>
    <jvmArgument>-Xms1024m</jvmArgument>
    <jvmArgument>-Xmx2048m</jvmArgument>
  </jvmArguments>
</dex>

Original comment by william....@xandar.com.au on 25 Apr 2014 at 6:39

GoogleCodeExporter commented 9 years ago
Thank you. that's what i want and help me a lot.

I have read the following page ,but did not found the detail of the 
configuration.

"http://books.sonatype.com/mvnref-book/reference/android-dev.html".

The page you give above is very usefull,but it seems there is no direct link in 
homepage and the references.however,i got it now. ^_^

And,after read the page,another question comes to me. How to config the dex 
phase to generate multi-dex? You know,the dex tool can generate serveral dex 
files if use --multi-dex option. This is fatal when the project is too 
complex,it may have more than 65336(2^32) methods,then the process will die. 
would you please help me again?

Thanks

Original comment by com.aimo...@gmail.com on 25 Apr 2014 at 7:18

GoogleCodeExporter commented 9 years ago
You can use the aaptExtraArgs property to pass in any extra argument you want 
when dexing.

Original comment by william....@xandar.com.au on 25 Apr 2014 at 9:15