I am using eclipse compiler in ant & building around 8000 files.I am getting OutOfMemory Exception even though i have set the max memory to 1250mb.
The same process though javac compiler runs fine with only 550mb memory.
What other parameter do I need to set so that it compiles through eclipse compiler too.
What have you done to verify that the heap setting is being used? Exactly what did you do to change the heap size?
Joined: Jun 28, 2008
Actually I am just setting the memorymaximumsize attribute to 1250 mb .
I was going through the Ant docs and found an interesting piece of information.
The memorymaximumsize is used only if the javac is run externally,otherwise ignored.So in my case its getting ignored as fork settings are getting ignored.
Now what to do?
set your JVM arguments in eclipse before running the ant script (go to ant file try any as provide the JVM arguments), some times eclipse is not considering the JVM arguments through ant script. I did experienced the same , passing the virtual arguments in eclipse -Xmx=512m or -Xmx=1024m, hope it will resolve your issue
To set the heap size for Ant, set the ANT_OPTS env var before running Ant. On Windows:
By the way, Ant is run from a script (ant_home/bin/ant.bat on Windows, ant_home/bin/ant on Linux). You could even set ANT_OPTS in the script.
Joined: Jun 28, 2008
Thanks Tirupathi , but I am not using eclipse.
Thanks Peter,I have used ANT_OPTS while running checkstyle task,but i didn't know that we can do the same for building files too.
I will try & inform about the result.
i am building jar by using ant, and getting the same exception
[ejbc] The system is out of resources.
[ejbc] Consult the following stack trace for details.
[ejbc] java.lang.OutOfMemoryError: Java heap space
[ejbc] Exec failed .. exiting
build.xml:102: Exception while calling weblogic.ejbc. Details: Ejbc reported an error.
i have tried all the scenarios what Peter has specified. like
from command prompt set ANT_OPTS=-Xmx1024m and modified ant.bat file adding "set ANT_OPTS=-Xmx1024m" still the error is not yet resolved. i am giving patch of my build.xml file where am getting error.