Hi! On Mon, 2012-04-16 at 15:19:38 +0100, Ben Harris wrote: > Package: libdpkg-perl > Version: 1.16.2 > Severity: normal > Tags: patch > > When I run a Perl script that repeatedly creates unreferenced > Dpkg::Control objects, the perl process (as shown in "top") consumes > memory without limit. > > A one-line sample: > > perl -MDpkg::Control -e 'Dpkg::Control->new while 1' > > I would expect a script like this to have a constant memory usage, > as the Dpkg::Control objects are garbage-collected soon after being > created. What I find, though is that after running for thirty > seconds, perl has consumed over 100 MB of memory. > > By contrast, the same test using Dpkg::Index consumes a constant 6 MB. > > This problem effectively means that a process can't operate on a > large number of Dpkg::Control objects sequentially. I discovered > this when I wrote a program that iterated over all the packages in > every current Ubuntu release and my system ran out of memory. > > The cause of the problem appears to the a circular reference between > a Dpkg::Control::Hash and its contained tied hash. I've attached a > patch that explicitly breaks this loop when a Dpkg::Control::Hash is > destroyed, following the advice in perlobj(1). This appears to > solve the memory leak and to pass "debian/rules check".
Thanks, merged locally, will be included in my next push targetting 1.16.3. regards, guillem -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org