Greetings,

        I am using Apache 1.3.9 on Linux kernel 2.0.36 using 
ApacheASP wrapped around my CGI scripts.  I have the following 
test script which works fine unless I declare the array variable 
"v" as "my @v".  This causes massive memory consumption in that 
much more memory is allocated each time the script is run, even 
though only 2 instances are actually run.  If "v" is NOT declared 
as "my", it seems to work fine (1st 2 invocations load up and 
scarf up memory, but after that, things run fine).  Can anyone 
tell me why this is?

Please reply via email ([EMAIL PROTECTED])

Thanks in advance!
Jim Turner


Here is my ASP config:
----------------------------------------------
<Files ~ \.asp$>
        SetHandler perl-script
        PerlHandler Apache::ASP
        PerlSetVar Global .
        PerlSetVar Debug 0
        PerlSetVar NoState 1
</Files>
----------------------------------------------
Here is my ASP file:
----------------------------------------------
<%

<!--#include file=test-->

%>
----------------------------------------------
Here is my test script (runs as CGI, FAST-CGI, and ASP):
----------------------------------------------
#!/usr/bin/perl

if ($0 =~ /\.asp/i)
{
        $runtype = 2;  #RUNNING AS ASP!
}
elsif ($0 =~ /\.fpl/i)
{
        $runtype = 1;  #RUNNING AS FAST-CGI!
}
else
{
        $runtype = 0;  #RUNNING AS REGULAR CGI!
}

require 'global.asa';

srand($$);
my ($randpid) = $$;

$mainloop = 0;
mainloop:  while ($runtype != 1 || new CGI::Fast)
{
        last  if ($mainloop && $runtype != 1);
        ++$mainloop;
        ++$runcnt;
        $randpid = int(rand(9999));
        &Home();
}

sub Home
{
        print &CGI::header()  unless (shift);

print "<BR>PID=$$= rc=$runcnt=\n";
        my @v = ();
        for (my $i=0;$i<=150000;$i++)
        {
                push (@v, $i);
        }
print "<BR>1st=$v[0]= last=$v[150000]=\n";
}

----------------------------------------------
Here is my global.asa
----------------------------------------------
use CGI::Fast qw(:standard);
use CGI qw(:standard);

sub Application_OnStart
{
}

1;
----------------------------------------------



____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at 
http://home.netscape.com/webmail

Reply via email to