Skip Menu |

This queue is for tickets about the XML-Easy CPAN distribution.

Report information
The Basics
Id: 62168
Status: resolved
Priority: 0/
Queue: XML-Easy

People
Owner: Nobody in particular
Requestors: MARKF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.006
Fixed in: (no value)



Subject: Memory Leak in XML::Easy::Content->new()
Hey Zefram, XML::Easy::Content->new() is leaking memory #!/usr/bin/perl use strict; use warnings; use XML::Easy::Content; use XML::Easy::Element; use IO::File; sub vmem_size() { my $fh = IO::File->new("/proc/self/status", "r") or return undef; local $/ = "\n"; while(defined(my $line = $fh->getline)) { return $1 if $line =~ /\AVmSize:[ \t]*([0-9]+)[ \t]*kB[ \t]*\n\z/; } return undef; } my $size = vmem_size; for my $count (1..5000) { # LEAKY CODE! XML::Easy::Content->new(["",XML::Easy::Element->new("exml",{},[""]),""]); my $new_size = vmem_size; if ($new_size != $size) { $size = $new_size; print $size, "\n"; } } prints 4620 4612 4744 4740 4872 4868 5000 4996 5128 5124 5256 5252 5384 5380 5512 5504 5636 5632 5628 5760 5756 5888 5884 6016 6012 6144 6140 6272 6268 6400 6392 6524 6520 6652 6648 6780 6772 I'm using the XS version (according to /Babel/scripts/modules-check.t) ok 85 - XML::Easy::xml10_read_document implemented in XS ok 86 - XML::Easy::Element::new implemented in XS
Subject: Re: [rt.cpan.org #62168] Memory Leak in XML::Easy::Content->new()
Date: Fri, 15 Oct 2010 17:06:02 +0100
To: MARKF via RT <bug-XML-Easy [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
MARKF via RT wrote: Show quoted text
>XML::Easy::Content->new() is leaking memory
Thanks. Fixed in XML-Easy-0.007, now uploaded to CPAN. -zefram