Skip Menu |

This queue is for tickets about the Net-SSH-Perl CPAN distribution.

Report information
The Basics
Id: 19985
Status: open
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: Nobody in particular
Requestors: danny [...] keyop.co.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.28
  • 1.29
  • 1.35
Fixed in: (no value)



Subject: Memory leak
Hi, We're using a build of perl 5.6.1, and Net::SSH::Perl 1.30 (not listed on the 'rt' drop down list!) on various flavours of RedHat/Fedora. We've been tracing a memory leak, which eventually has lead to a subroutine which was creating a new Net::SSH::Perl object each time it was called. However, when leaving the routine (and hence the scope of the object), memory doesn't seem to be being released. The problem can be demonstrated with the following simple script, which will slowly consume more and more memory: #!/packages/ksite/perl/bin/perl -w use strict; use Carp; use Net::SSH::Perl; while (1) { my $sshhandle = new Net::SSH::Perl("infinistore.cinesite.co.uk", (debug=>0, protocol=>1)); if ( ! defined $sshhandle ) { croak("FATAL:: Unable to make ssh connection.\n"); } $sshhandle->login("root",undef); my ($out,$err,$exit)=$sshhandle->cmd('date'); if ( $exit ) { my $message="FATAL:: Unable to open ssh connection. Error was ".$err; croak ($message); } undef $sshhandle; } We're going to work around this for now by having a single Net::SSH::Perl object, but as I understand things this code should work Ok, and fully destroy all of the data associated with the object each time round the loop? Any help appreciated. Danny
Confirmed with v1.35. With both, SSH1 and SSH2. Seems to grow slower with SSH2 (but that's just a feeling). Steffen -- Steffen Schwigon <ss5@renormalist.net> Dresden Perl Mongers <http://dresden-pm.org/>
On Wed Dec 05 14:48:22 2012, SCHWIGON wrote: Show quoted text
> Confirmed with v1.35.
...using Perl 5.16.2.