I'm trying to use ANTLR V4
with the publicly given Java 8
grammar
- https://github.com/antlr/grammars-v4/blob/master/java8/Java8.g4
I generated the class files and tried to parse the Java 8 JRE
, but somehow at java.text.SimpleDateFormat.java
it crashes with:
java.lang.OutOfMemoryError: GC overhead limit exceeded
It also crashes, when I'm trying to parse that single file alone.
Can this be solved somehow? Obviously ANTLR V4
can't handle files with more than 2000 LOC? Is that a correct assumption?
What I've done so far:
Changing assigned memory to
JVM
in multiple steps from 256MB up to 4GB - it then changes tojava.lang.OutOfMemoryError: Java heap space
To ensure that there is no syntactical problem with the input-file
At first I removed the first half of the file -> parsing seems okay,
then undid that action and removed the second half of the file -> parsing seems okay
-Xmx
? – Killoughjava -Xmx4096m -cp .:antlr-4.5.1-complete.jar org.antlr.v4.gui.TestRig Java8 compilationUnit SimpleDateFormat.java
and it finished without issue.2048
exceeded the GC limit. It could just be the harness is a pig. – Killough42.01 real 163.79 user 5.18 sys
; OSX, java1.8.0_51
. This is a 3 year old macbook pro; so nothing really special. – Killough