Skip Menu |

This queue is for tickets about the Safe CPAN distribution.

Report information
The Basics
Id: 60217
Status: open
Priority: 0/
Queue: Safe

People
Owner: Nobody in particular
Requestors: sjq-perl [...] jadevine.org.uk
Cc:
AdminCc:

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



Subject: Memory leak on perl 5.8.8
I am seeing a memory leak when creating (and immediately destroying) lots of Safe objects. This is with perl 5.8.8 and Safe 2.27. Attached is a fairly simple script which demonstrates the issue. Creating 100 Safe objects shows a couple of leaks of about 135000 bytes. I think this is a general 5.8.8 problem but, for information, I am doing this on RHEL5.5 with perl 5.8.8-32.el5_5.1. I have also seen this with Safe 2.12 and 5.8.8-27.el5 but then it takes in the order of 10,000 objects to cause leaks. I have reports that this also occurs on SLES 10 with perl 5.8.8 and Safe 2.12. I have tried this with perl 5.10 on Fedora 13 and cannot make it leak even with 100,000 object creations. Stephen
Subject: safe_leak.pl
#!/usr/bin/perl use strict; use warnings; use Safe (); use IO::File (); my $num = $ARGV[0] || 1000; my $cur_size = get_rss(); print "Start size: $cur_size\n"; for my $i (1..$num) { my $cpt = Safe->new(); my $new_size = get_rss(); my $change = $new_size - $cur_size; if ( $change > 0 ) { print "Iteration $i: Memory usage changed: $change\n"; $cur_size = $new_size; } } sub get_rss { my $file = "/proc/$$/stat"; my $fh = IO::File->new( $file, 'r' ) or die "Could not open $file: $!\n"; chomp( my $data = <$fh> ); $fh->close; my $rss = (split ' ', $data)[22]; return $rss; }
Subject: [rt.cpan.org #60217]
Date: Wed, 2 Nov 2016 15:39:27 +0200
To: bug-Safe [...] rt.cpan.org
From: Matti Linnanvuori <matti.linnanvuori [...] portalify.com>
I can reproduce the memory leak in Red Hat Enterprise Linux and CentOS 7.2 (Perl v5.16.3), SUSE Linux Enterprise Linux SP1 (Perl 5.10.0).