OutOfMemoryError when parsing incorrect input in ANTLR
Actually this issue is related with my previous question Catching ANTLR's NoViableAltException in Java and ANTLRWorks Debugger , but I decided to split them because of different symptoms. The issue is about feeding to ANTLR input text, which contains unknown tokens. Consider for example, that our grammar doesn't known anything about tokens which start with @ symbol. If we will try to feed such text to ANTLRWorks interpreter, we will receive NoViableAltException in result graph. But if we will take generated and compiled grammar in Java and try to parse such invalid text with it, we can receive