develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #1376] Memory leak in IO::Socket ?

From:
Michael G Schwern via RT
Date:
July 12, 2005 18:55
Subject:
[perl #1376] Memory leak in IO::Socket ?
Message ID:
rt-3.0.11-1376-117085.11.6327162022995@perl.org
> [RT_System - Sun Sep 19 18:30:17 1999]:
> 
> I appear to be running into a memory leak in IO::Socket which I can't
> fix. The
> following example:
> 
> #!/usr/bin/perl -w
> use strict;
> use IO::Socket;
> 
> my $RemoteHost = 'localhost';
> while (1) {
>    my $Socket = new IO::Socket::INET(PeerAddr => $RemoteHost,
>                                         PeerPort => 80,
>                                       Proto => 'tcp',
>                                       Type => SOCK_STREAM,
>                                      );
>    $Socket->close();
>    undef $Socket;
> }
> 
> I can't see anything obviously wrong with this.

I cannot replicate this on OS X using 5.4.5 and 5.5.4.  Are you still
having this problem in newer Perls and versions of IO?




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About