Reputation: 481
To the guys keen to tag it as a duplicate question, please wait and read below:
Before posting this question, I have searched the SO extensively but none of the solution given for the OutOfMemoryError worked for me. I was getting this issue when using the ant build. The solution that didn't work:
1. export ANT_OPTS=-Xmx1g
ant
2. set ANT_OPTS=-Xmx1g
ant
3. export ANT_OPTS="-Xmx2g -XX:MaxPermSize=512m"
and few others as well
Upvotes: 0
Views: 2506
Reputation: 481
So here is the solution that I found for my problem:
Since the project that was failing and throwing OutOfMemory error has it own build.xml file. In the build.xml file, there was a property tag that allocates the memory needed for java compiler. That memory was low. After increasing the memory allocation, it resolved my problem.
<property name="javac.max.memory" value="2024M" />
Hope it helps
Upvotes: 1