Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Memory leaking? - CGI.pm

by jlongino (Parson)
on May 08, 2002 at 01:02 UTC ( [id://164874]=note: print w/replies, xml ) Need Help??


in reply to Memory leaking? - CGI.pm

I'm not sure what version (perl, CGI) you're running, but I don't seem to be able to duplicate the problem in either of my two environments:
WinXP: perl, v5.6.1 built for MSWin32-x86-multi-thread Binary build 631 provided by ActiveState Tool Corp. Built 17:16:22 Jan + 2 2002 $CGI::revision = '$Id: CGI.pm,v 1.49 2001/02/04 23:08:39 lstein Exp $' +; $CGI::VERSION='2.752'; Solaris 8: perl, v5.6.0 built for sun4-solaris $CGI::revision = '$Id: CGI.pm,v 1.19 1999/08/31 17:04:37 lstein Exp $' +; $CGI::VERSION='2.56';
Neither of the boxen had leaks running the following:
use strict; use CGI; $|++; my $ct = 0; while (1) { $ct++; if (1) { my $cgi = new CGI("q=$ct"); my $blah = $cgi->param('q'); print " blah: $blah\n"; } }
On the PC I let them run for more than 256 seconds (256 MB RAM) and I monitored the Solaris version using top with no visible memory leaks. You might try running my code and see if it leaks as well, but I don't think CGI.pm is the cause.

--Jim

Replies are listed 'Best First'.
Re: Re: Memory leaking? - CGI.pm
by ariels (Curate) on May 08, 2002 at 07:42 UTC

    Removing the `print' command, and running on Solaris, definitely shows a memory leak (at around 0.4MB/sec) if I run with Perl 5.005.

    % uname -a SunOS mir 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-2 % perl -MCGI -le 'print $CGI::VERSION' 2.46
    Running with Perl 5.6.1 on the same platform, I observe no memory leak. This is strange.

Re: Re: Memory leaking? - CGI.pm
by daviddhall (Sexton) on May 08, 2002 at 08:22 UTC
    I ran your code, and it definetly shows memory disappearing...

    BTW, here's the version info for my perl:
    "This is perl, version 5.005_02 built for alpha-dec_osf"

    I guess maybe from what the other guy posted things might be better with a newer version of perl.
      BTW, if upgrading your version of Perl is a problem (some work environments are particular about that sorta thing), you might consider just installing a newer version of CGI.pm and see if that helps first. I don't know what the ramifciations of the CGI-only upgrade would be--maybe you could start a separate thread on that. I'd be interested in reading the replies, just out of curiosity.

      --Jim

      Update: make sure the version of CGI.pm you install is compatible with 5.005_02 built for alpha-dec_osf.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://164874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found