android compile error: could not reserve enough space for object heap
- by moonlightcheese
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