[antlr-interest] How to free ANTLR3_STRING (c runtime)?

Jim Idle jimi at temporal-wave.com
Fri May 15 16:27:18 PDT 2009


Chetty, Jay wrote:
> Jim thanks for the reply.
>
> My understanding was also that string factory will manage the life time of the strings it created.
> But ran into out of memory issue on a 32 bit machine, so thought of freeing up some strings that 
> Were created while forward looking some tokens during error reporting.
>   
> As you suggested I will access the token structure directly.
>   
It is better if you are building big outputs, but string factory is fine 
for smaller outputs where you just want something that looks after 
memory for you and so on.
> And thanks for info on dot generator , I will give it a try.
>
> Note:
> By the way the toStringSS() function doesn't check for the pointer returned by the string factory 
> (so and seg faults when out of memory).
>   
It probably should, but you must be creating some huge structure for it 
to run out of memory. What are you parsing?

Or do you have your ulimits very low or something? Make sure you are are 
running 3.1.3 runtime as this has a fair bit of memory optimization on 
tree building.


Jim


More information about the antlr-interest mailing list