0

I am getting this below error upon running build.xml file running through ANT through Eclipse although I am passing additional vm arguments -Xms512m -Xmx1524m, but still I am getting out of heap space error. Please advise how to fix this.

compileEJBSource:
     [echo] compileEJBSource ...
    [javac] Compiling 4 source files to C:\AVN\FT\CoreERT\Product\classes
    [javac] The system is out of resources.
    [javac] Consult the following stack trace for details.
    [javac] java.lang.OutOfMemoryError: Java heap space
    [javac]     at com.sun.tools.javac.parser.Scanner.getRawCharacters(Scanner.java:1075)
    [javac]     at com.sun.tools.javac.parser.DocCommentScanner.getLineMap(DocCommentScanner.java:417)
    [javac]     at com.sun.tools.javac.parser.JavacParser.parseCompilationUnit(JavacParser.java:2310)
    [javac]     at com.sun.tools.javac.parser.EndPosParser.parseCompilationUnit(EndPosParser.java:83)
    [javac]     at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:595)
    [javac]     at com.sun.tools.javac.main.JavaCompiler.complete(JavaCompiler.java:741)
Thomas Fritsch
  • 7,861
  • 33
  • 31
  • 41
  • What research have you done? What have you tried? What's up with your user name? – nicomp Jun 27 '18 at 16:13
  • try to print your vm arguments and see whether it is there. – Janath Jun 27 '18 at 16:13
  • Janath how we can print the same in build.xml do we need to echo in the build.xml file –  Jun 27 '18 at 16:17
  • How to overcome: 1) Increase heap size of Ant process, e.g. `-Xmx3g`, 2) Use `` – Andreas Jun 27 '18 at 16:20
  • Possible duplicate of [How to deal with "java.lang.OutOfMemoryError: Java heap space" error (64MB heap size)](https://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap) – Mani Deep Jun 27 '18 at 16:29
  • https://stackoverflow.com/q/9314551/1531971 –  Jun 27 '18 at 16:35

1 Answers1

0

You could set it as an option for ANT. Use "ANT_OPTS"

set ANT_OPTS=-Xmx2G -XX:MaxPermSize=512m

Please see Increase memory for ant

Tobias Otto
  • 1,512
  • 10
  • 18