I'm trying to parse a java file(11K+ lines of codes) with ANTLR java8 grammar but it crashed with OOM exception. I also tried the solutions suggested in this two links using ANTLR in java cause OOM (using UnbufferedTokenStream) and ANTLR V4 + Java8 Grammar -> OutOfMemoryException (using two-stage parsing strategy) but both throws same OOM error. Memory provided -Xms512m and -Xmx1G Can this be solved somehow? |