I run "Error: Java heap heap, java.lang.OutOfMemoryError: Java heap space" when compiling an existing project on OS X (Snow Leopard).
I use the default 64-bit SDK for Java 1.6 by default and the default installation of Ant (both provided as part of the OS).
I ran into this problem in other OS environments and usually resolve it with ANT_OPTS to increase the allocated memory, but this does not seem to work.
I tried setting ANT_OPTS as follows:
In the same shell I entered
export ANT_OPTS = "- Xmx1024m 'ant build
I also tried setting the value to ~ / .bash_profile (which I got to make sure it was raised).
I eventually solved the memory problem by increasing the memory in the javac task in my Ant script, but this is not ideal (I would rather use ANT_OPTS).
What is the right way to increase the amount of heap memory when running Ant on OS X?
UPDATE:
It seems that I was wrong, and ANT_OPTS is removed as an exception. The problem is that I am deploying a javac task (as described in bkail below).
This leads me to the next question. Why does the JAVAC process run out of memory in OSX when the same code / ant script works fine on Linux? What is the difference between the standard OSX installation of Java, which means that it requires dedicated additional memory?
source
share