Yes, it just leak... sort of.
More specifically, I understand the mechanism behind the leaking, and
just haven't which of two potential methods to fix it with.
It's a simple refcount/circular problem, and so for now you should make
sure you manually ->DESTROY all Document objects when you are finished
with them.
for(1..100000) {
my $Document = PPI::Document->new(q[print "Foo!"}]);
$Document->DESTROY;
}
I'll leave the bug report here for now, until the final choice over
circular avoidance has been made.
Adam K
Michael_Schilli via RT wrote:
Show quoted text> This message about PPI was sent to you by MSCHILLI <MSCHILLI@cpan.org> via rt.cpan.org
>
> Full context and any attached attachments can be found at:
> <URL:
https://rt.cpan.org/Ticket/Display.html?id=11522 >
>
> Hi Adam,
>
> looks like your excellent PPI module leaks memory:
>
> for(1..100000) {
> my $Document = PPI::Document->new(q[print "Foo!"}]);
> }
>
> will grow the memory footprint of the process continuously. Would be great if you could look into it. Thanks!
>
> -- Mike
>