Hi Jim,

So I have debug debug and have found that

=================
1) Generated Parser contains ctx->adaptor, which contains one more
tokenFactory. And for this factory NEVER is called reset().

I have add call reset() for now in the method of generated parser.
This have made things better, but still I see at least two players...

So next player is:

=================
2) This adaptor also has more deeply hidden factory of trees.
And it is called a lots for nilNode().

And this factory 
    typedef    struct ANTLR3_ARBORETUM_struct

Although is very similar to
    typedef    struct ANTLR3_TOKEN_FACTORY_struct

In work with pools, it do NOT have reset() function.

So I think I will try add reset() method to this struct,
And call it from generated parser reset() method as following


static void
SqlParser_v3ParserReset (pSqlParser_v3Parser ctx)
{
    RECOGNIZER->reset(RECOGNIZER);
    
    // RZ added this to see if this fixes grow of RAM.
    
    ADAPTOR->tokenFactory->reset( ADAPTOR->tokenFactory );
    
    ((pANTLR3_COMMON_TREE_ADAPTOR)(ADAPTOR->super))->arboretum->reset(
        (ADAPTOR->super))->arboretum);
}



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to