Getting exception while compiling javac

212 views
Skip to first unread message

afishler

unread,
Oct 5, 2009, 6:03:19 AM10/5/09
to Project Lombok
I am compiling on an ubuntu machine
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

when I build from scratch this is what I am getting. Any ideas? need
to get this running ASAP

An annotation processor threw an uncaught exception.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError: Java heap space
[javac] at java.util.AbstractList.iterator(AbstractList.java:
273)
[javac] at lombok.core.AST$Node.<init>(AST.java:174)
[javac] at lombok.javac.JavacAST$Node.<init>(JavacAST.java:
282)
[javac] at lombok.javac.JavacAST.drill(JavacAST.java:259)
[javac] at lombok.javac.JavacAST.buildStatementOrExpression
(JavacAST.java:253)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:159)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:58)
[javac] at lombok.core.AST.buildWithField0(AST.java:572)
[javac] at lombok.core.AST.buildWithField(AST.java:478)
[javac] at lombok.javac.JavacAST.drill(JavacAST.java:258)
[javac] at lombok.javac.JavacAST.buildStatementOrExpression
(JavacAST.java:253)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:159)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:58)
[javac] at lombok.core.AST.buildWithField0(AST.java:572)
[javac] at lombok.core.AST.buildWithField(AST.java:478)
[javac] at lombok.javac.JavacAST.drill(JavacAST.java:258)
[javac] at lombok.javac.JavacAST.buildStatementOrExpression
(JavacAST.java:253)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:159)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:58)
[javac] at lombok.core.AST.buildWithField0(AST.java:572)
[javac] at lombok.core.AST.buildWithField(AST.java:478)
[javac] at lombok.javac.JavacAST.drill(JavacAST.java:258)
[javac] at lombok.javac.JavacAST.buildStatementOrExpression
(JavacAST.java:253)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:159)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:58)
[javac] at lombok.core.AST.buildWithField0(AST.java:572)
[javac] at lombok.core.AST.buildWithField(AST.java:478)
[javac] at lombok.javac.JavacAST.drill(JavacAST.java:258)
[javac] at lombok.javac.JavacAST.buildStatementOrExpression
(JavacAST.java:253)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:159)
[javac] at lombok.javac.JavacAST.buildTree(JavacAST.java:58)
[javac] at lombok.core.AST.buildWithField0(AST.java:572)

Reinier Zwitserloot

unread,
Oct 5, 2009, 6:09:17 AM10/5/09
to Project Lombok
Can you post the java source you're trying to compile? Looks like a
lombok bug, but to fix it, we'll need to know what's causing it.

afishler

unread,
Oct 5, 2009, 6:15:21 AM10/5/09
to Project Lombok
I have more than 1000 files compiled on this clean build...is there a
way for me to find what was it building when it failed?

afishler

unread,
Oct 5, 2009, 6:16:55 AM10/5/09
to Project Lombok
I have more than 1000 files compiled on this clean build...is there a
way for me to find what was it building when it failed?

On Oct 5, 12:09 pm, Reinier Zwitserloot <reini...@gmail.com> wrote:

Reinier Zwitserloot

unread,
Oct 5, 2009, 6:28:17 AM10/5/09
to Project Lombok
Uh, no. There really shouldn't be a loop, possibly you're really just
running out of heap. Try this:

javac -J-Xmx2048m *.java

Arie Fishler

unread,
Oct 5, 2009, 6:36:59 AM10/5/09
to project...@googlegroups.com
memory increased and it seems to work. why is such a substantial increase in mem requirements because of lombok during compile?

Reinier Zwitserloot

unread,
Oct 5, 2009, 11:59:15 AM10/5/09
to Project Lombok
Unlike javac, lombok uses recursion to fish all the child nodes out of
a given node (each child node has its own children, and so on and so
forth). Apparently you've got sufficient nesting going on that you're
running out of heap. We also create a copy of each AST, because
javac's AST does not allow 2-way traversal, which is something we
really do need. Thus, compiling with lombok requires twice the memory,
at least. As java, by default, only gives a measly 64MB of memory to a
new process, I don't think this makes lombok particularly slow and/or
demanding on the hardware. The need to put in a cryptic parameter (-J-
Xmx) is annoying, though. If you want, file an issue with that stack
trace so lombok can at least suggest you add -J-Xmx to the compile
run, and if possible we should investigate if we can lower heap
requirements. It won't be a priority though - we've got too much to do
as is :P

On Oct 5, 12:36 pm, Arie Fishler <afish...@gmail.com> wrote:
> memory increased and it seems to work. why is such a substantial increase in
> mem requirements because of lombok during compile?
>

Arie Fishler

unread,
Oct 5, 2009, 12:04:55 PM10/5/09
to project...@googlegroups.com
Thanks for the explanation. I just did it through the javac ant task and did not have to add so much heap (tried 256m and it worked for me).

I'll take this opportunity to thank you for a great project....should have found it earlier and my classes would look much thinner....great work guys!
Reply all
Reply to author
Forward
0 new messages