trystanzj/Farly — pull request #4 by lukas-t (2013-06-08 18:42:35+00:00)
Title: Found Memory Leak in Farly::ASA::Parser

I noticed that the parsetree created by Farly::ASA::Parser contains unweakened circular references and is therefore causing a memory leak.

See t/asa_Parser_memorycycles.t

An other way to validate the issue:

run
perl -Ilib -MFarly -e 'while(1){my $f = Farly->new; $f->process("ASA", "t/test.cfg");}'

and watch perl eating your memory for lunch =)

I noticed that removing all the actions (the "bless \%item ..." stuff) from the grammar fixes the memory leak, but makes several other tests fail. (Which is not a surprise for me)

This memory leak makes it impossible to use Farly to process several huge configurations in a long running perl script, which is kind of a showstopper (at least for me).