OutOfMemoryError when building project with jmh-generator-annprocess dependency

Aleksey Shipilev shade at redhat.com
Mon Oct 2 10:34:40 UTC 2017


On 09/28/2017 12:52 AM, Meng, David wrote:
> The system is out of resources.
> Consult the following stack trace for details.
> java.lang.OutOfMemoryError: Java heap space
>         at com.sun.tools.javac.code.Scope.dble(Scope.java:173)
>         at com.sun.tools.javac.code.Scope.enter(Scope.java:213)
>         at com.sun.tools.javac.comp.MemberEnter$2.importFrom(MemberEnter.java:229)
>         at com.sun.tools.javac.comp.MemberEnter$2.importFrom(MemberEnter.java:220)
>         at com.sun.tools.javac.comp.MemberEnter$2.run(MemberEnter.java:234)
>         at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:143)
>         at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
>         at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
>         at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
>         at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
>         at com.sun.tools.javac.main.JavaCompiler.enterTreesIfNeeded(JavaCompiler.java:965)
>         at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1242)
>         at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
>         at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
>         at com.sun.tools.javac.main.Main.compile(Main.java:523)
>         at com.sun.tools.javac.main.Main.compile(Main.java:381)
>         at com.sun.tools.javac.main.Main.compile(Main.java:370)
>         at com.sun.tools.javac.main.Main.compile(Main.java:361)
>         at com.sun.tools.javac.Main.compile(Main.java:56)
>         at com.sun.tools.javac.Main.main(Main.java:42)
> 
> I've tried increasing the memory allocation via the following arguments: '-Xmx4096m -Xms4096m -Xss4096m'

Stack size = 4 GB would quite probably overflow any reasonable system.

> Do you know what might be the cause of the OOM error?

No, hard to tell without the reproducer, and without knowing the exact build configuration.
Transplant your code to archetype-generated JMH project, and see if that is the build configuration
fault.

Thanks,
-Aleksey




More information about the jmh-dev mailing list