I have created a simple perl script. The only thing it does is waiting for 5 seconds.
When I spawn the script on the server through mod_perl, it takes a lot of memory. The instance takes 36 megabytes.
Why there is so much memory is allocated? How can I minimize the memory taken from the system by the running script?
This is the output of "top" utility when running 2 scripts.
5162 www-data 25 0 36732 8124 2868 S 1.3 3.1 0:00.05 apache2
5161 www-data 25 0 36732 8124 2868 S 0.7 3.1 0:00.04 apache2
The script.
#!/usr/bin/perl
use CGI;
my $query= new CGI;
my $content = "5 second delay...\n";
$query->header(
'-Content-type' => "text/plain",
'-Content-Length' => length($content)
);
print $content;
sleep(5);