I have written a parser in ANTLR3. Targets are both Java and CSharp3. Both are using a lot of memory at parse time. The files I am parsing have a size between 5 and 40 MB. Memory Usage is far beyond that, iirc correctly a .NET Memory profiler showed a peak of over 600MB. The grammar file has about 500 lines. I just need the output generated by my injected Code in the grammar. I do not need all lexer tokens in memory or the AST.
Is there anything I can do? Does ANTLR4 address memory usage issues?