do you have any idea why I could get a ‘Exception in thread “main” java.lang.OutOfMemoryError: Java heap space’ error when building my android app, even though I added -vmargs -Xmx1024M -Xms512M to the eclipse arguments ?
I would like to know what error could I have made that would trigger such an error at build time, as it would appear to me that only a bug in eclipse or maven could produce such an error at build time.
I am using run as maven install to build my application (with the maven android eclipse plugin). Run as-> ‘maven package’ also produces the same build failure, after waiting roughly 1min30.
I have a desktop computer with 3GB of memory, and my application isn’t nearly that big.
Thanks.
Add
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/some/pathto your jvm args so that when it runs out of memory it will dump out the heap. You can then use Eclipse Memory Analyser orjhatto browse the heap and diagnose where the problem might be.Update: Try increasing the memory of your maven android plugin. In your
pom.xml, add a JVM argument forXmxto the plugin configuration: