Yohimbe has asked for the wisdom of the Perl Monks concerning the following question:
What is the correct jargon for the 3 separate constructs? I think of them as references, copies and another syntax to do a reference that I think of as pointers.#!/usr/bin/perl use strict; sub handler { my %foo=(a=>1,b=>2,c=>3); a(\%foo); print "A -> $foo{a} B -> $foo{b} C -> $foo{c}\n" ; } sub a { my $ref=shift; $ref->{a} = 100; my %copy=%$ref; $copy{a} = 10; my $ptr =\$ref->{b}; $$ptr = 20; }
Similarly, I have a mod_perl based system thats just crazy for ram use.
With PerlFreshRestart On, the parents and children grow by 30 megs a day. But, strangely enough, they grow only in the shared section. private section ( difference between ram and shared size) is only about 2 megs per process.
It seems that somehow PerlFreshRestart does not re-use the ram allocated for earlier copies of the libraries. I've turned off FreshRestart but it still seems to leak. I SIGUSR1 the process every night for log rotation, and this seems to be when the process memory growth occurs.
Anything I can do?
--
Jay "Yohimbe" Thorne, alpha geek for UserFriendly
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A question of memory, mod_perl, and references and subroutines
by Masem (Monsignor) on Apr 15, 2001 at 18:06 UTC | |
|
Memory, Perl and the OS
by knobunc (Pilgrim) on Apr 16, 2001 at 18:51 UTC |