something is wrong here. apache 2.0.45,mod_perl 1.99_08 and perl 5.8.0

The following little script running under ModPerl::Registry makes
consuming all the memory and not releasing it back. Its not a
classical memleak, cause the consumed mem does not increase. If
running in single-server-mode the consumed mem stays at approx. 200M,
and if I run apache in standard prefork-mode and call the script a few
times all apache-threads want 200M and it eats up all my mem and in
error_log I get:

Out of memory!
Callback called exit.

----------------------------
#! /usr/bin/perl -w

use strict;
use CGI;

run();

sub run{
  my @x=();
  $#x=50000000;  # this is the big one
  my $q=new CGI;
  print $q->header(),$q->start_html();
  print int(rand(10000));
  print $q->end_html(),"\n";
# my @x=();
# undef @x;
}
----------------------------

I tried to set @x=() at the end of the sub, which did not change
anything. If I explictely undef @x the memory is released. 

 I triple-checked my logs if there is any 'stay not shared' or 'nested
subroutine' or whatever warning and I'm stubbornly convinced that there is a problem.
 imho apache should release the memory back when the sub is exited.

Please tell me where my brain-error is.

thnx,
peter


-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
[EMAIL PROTECTED]
http://www.goldfisch.at

Reply via email to