Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 11522
Status: resolved
Worked: 5 hours (300 min)
Priority: 0/
Queue: PPI

People
Owner: adamk [...] cpan.org
Requestors: m [...] perlmeister.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.902
Fixed in: (no value)



Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.415 (Entity 5.415)
Subject: PPI 0.902 leaks memory
X-RT-Original-Encoding: iso-8859-1
Content-Length: 273
Download (untitled) / with headers
text/plain 273b
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
Return-Path: <adam [...] phase-n.com>
X-Original-To: bug-PPI [...] rt.cpan.org
Delivered-To: cpan-bug+ppi [...] diesel.bestpractical.com
X-Greylist: delayed 401 seconds by postgrey-1.16 at diesel; Thu, 17 Feb 2005 00:30:36 EST
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 350E94D8071 for <bug-PPI [...] rt.cpan.org>; Thu, 17 Feb 2005 00:30:36 -0500 (EST)
Received: (qmail 5182 invoked by alias); 17 Feb 2005 05:22:16 -0000
X-Spam-Check-BY: la.mx.develooper.com
Received-SPF: neutral (x1.develooper.com: local policy)
Received: from starfury.linearg.com (HELO starfury.linearg.com) (202.90.48.2) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 16 Feb 2005 21:22:12 -0800
Received: from localhost (localhost [127.0.0.1]) by starfury.linearg.com (Postfix) with ESMTP id 45BD9804C530 for <bug-PPI [...] rt.cpan.org>; Thu, 17 Feb 2005 16:22:07 +1100 (EST)
Received: from starfury.linearg.com ([127.0.0.1]) by localhost (starfury [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24936-19 for <bug-PPI [...] rt.cpan.org>; Thu, 17 Feb 2005 16:22:07 +1100 (EST)
Received: from [172.31.0.178] (hq-nat.linearg.net [202.90.48.125]) by starfury.linearg.com (Postfix) with ESMTP id 2F7B4804C52E for <bug-PPI [...] rt.cpan.org>; Thu, 17 Feb 2005 16:22:07 +1100 (EST)
Message-ID: <4214299E.5050906 [...] phase-n.com>
Date: Thu, 17 Feb 2005 16:20:30 +1100
From: Adam Kennedy <adam [...] phase-n.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: bug-PPI [...] rt.cpan.org
Subject: Re: [cpan #11522] PPI 0.902 leaks memory
References: <rt-11522-33029.16.1416741199258 [...] cpan.org>
In-Reply-To: <rt-11522-33029.16.1416741199258 [...] cpan.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at linearg.com
RT-Send-Cc:
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1076
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 >
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.415 (Entity 5.415)
X-RT-Original-Encoding: iso-8859-1
Content-Length: 207
Download (untitled) / with headers
text/plain 207b
It looks like implementing weakening of the parent refs in PPI::XS is going to be absolutely trivial to do, so I've decided to go with compulsory weakening of %_PARENT entries for circular-leak prevention.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.