[antlr-interest] ANTLR running out of memory while parsing huge files

Jim Idle jimi at temporal-wave.com
Tue Apr 21 07:31:53 PDT 2009


Nick Vlassopoulos wrote:
> Hi Andreas,
>
> Thanks for your fast reply!
> So it should be something like a "line parser" that's instatiated for 
> each line of the BODY section!
>
No - you don't want to do this really, you will create millions of 
malloc/free calls - go with the custom input stream I mentioned and you 
will be fine. It sounds like you can easily pick out the faked EOF 
points without parsing them.

What is the input? If it is just millions of data elements, then you 
could parse the headers, then have the input stream traverse the data 
points with a little custom code, until the next header is seen.

Jim


More information about the antlr-interest mailing list