android compile error: could not reserve enough space for object heap

Posted by moonlightcheese on Stack Overflow See other posts from Stack Overflow or by moonlightcheese
Published on 2010-04-30T21:36:27Z Indexed on 2010/04/30 21:37 UTC
Read the original article Hit count: 451

Filed under:
|
|
|

I'm getting this error during compilation:

Error occurred during initialization of VM Could not create the Java virtual machine. Could not reserve enough space for object heap

What's worse, the error occurs intermittently. Sometimes it happens, sometimes it doesn't. It seems to be dependent on the amount of code in the application. If I get rid of some variables or drop some imported libraries, it will compile. Then when I add more to it, I get the error again.

I've included the following sources into the application in the [project_root]/src/ directory: org.apache.httpclient (I've stripped all references to log4j from the sources, so don't need it) org.apache.codec (as a dependency) org.apache.httpcore (dependency of httpclient) and my own activity code consisting of nothing more than an instance of HttpClient.

I know this has something to do with the amount of memory necessary during compile time or some compiler options, and I'm not really stressing my system while i'm coding. I've got 2GB of memory on this Core Duo laptop and windows reports only 860MB page file usage (haven't used any other memory tools. I should have plenty of memory and processing power for this... and I'm only compiling some common http libs... total of 406 source files. What gives?

Android API Level: 5 Android SDK rel 5 JDK version: 1.6.0_12

© Stack Overflow or respective owner

android compile error: could not reserve enough space for object heap

Posted by moonlightcheese on Stack Overflow See other posts from Stack Overflow or by moonlightcheese
Published on 2010-04-30T23:01:07Z Indexed on 2010/04/30 23:07 UTC
Read the original article Hit count: 451

Filed under:
|
|
|
|

I'm getting this error during compilation:

Error occurred during initialization of VM
Could not create the Java virtual machine.
Could not reserve enough space for object heap

What's worse, the error occurs intermittently. Sometimes it happens, sometimes it doesn't. It seems to be dependent on the amount of code in the application. If I get rid of some variables or drop some imported libraries, it will compile. Then when I add more to it, I get the error again.

I've included the following sources into the application in the [project_root]/src/ directory: org.apache.httpclient (I've stripped all references to log4j from the sources, so don't need it) org.apache.codec (as a dependency) org.apache.httpcore (dependency of httpclient) and my own activity code consisting of nothing more than an instance of HttpClient.

I know this has something to do with the amount of memory necessary during compile time or some compiler options, and I'm not really stressing my system while i'm coding. I've got 2GB of memory on this Core Duo laptop and windows reports only 860MB page file usage (haven't used any other memory tools. I should have plenty of memory and processing power for this... and I'm only compiling some common http libs... total of 406 source files. What gives?

edit (4/30/2010-18:24): Just compiled some code where I got the above stated error. I closed some web browser windows and recompiled the same exact code with no edits and it compiled with no issue. this is definitely a compiler issue related to memory usage. Any help would be great.... because I have no idea where to go from here.

Android API Level: 5 Android SDK rel 5 JDK version: 1.6.0_12

Sorry I had to repost this question because regardless of whether I use the native HttpClient class in the Android SDK or my custom version downloaded from apache, the error still occurs.

© Stack Overflow or respective owner

Related posts about android

Related posts about heap