Elizabeth Mattijsen wrote:
> At 09:18 AM 3/12/02 -0500, Bill Marrs wrote:
> 
>> If anyone has any ideas what might cause the httpd parent (and new 
>> children) to lose a big chunk of shared memory between them, please 
>> let me know.
> 
> 
> I've seen this happen many times.  One day it works fine, the next 
> you're in trouble.  And in my experience, it's not a matter of why this 
> avalanche effect happens, but is it more a matter of "why didn't it 
> happen before"?  You may not have realised it that you were just below a 
> "threshold" and now you're over it.  And the change can be as small as 
> the size of a heavily used template that suddenly gets over an internal 
> memory allocation border, which in turn causes Perl to allocate more, 
> which in turn causes memory to become unshared.
> 
> I have been thinking about a perl/C routine that would internally "use" 
> all of the memory that was already allocated by Perl.  Such a routine 
> would need to be called when the initial start of Apache is complete so 
> that any child that is spawned has a "saturated" memory pool, so that 
> any new variables would need to use newly allocated memory, which would 
> be unshared.  But at least all of that memory would be used for "new" 
> variables and not have the tendency to pollute "old" memory segments.
> 
> I'm not sure whether my assessment of the problem is correct.  I would 
> welcome any comments on this.

Nope Elizabeth, your explanation is not so correct. ;)
Shared memory is not about sharing the pre-allocated memory pool (heap 
memory). Once you re-use a bit of preallocated memory the sharing goes away.

Shared memory is about 'text'/read-only memory pages which never get 
modified and pages that can get modified but as long as they aren't 
modified they are shared. Unfortunately (in this aspect, but fortunately 
for many other aspects) Perl is not a strongly-typed (or whatever you 
call it) language, therefore it's extremely hard to share memory, 
because in Perl almost everything is data. Though as you could see Bill 
was able to share 43M out of 50M which is damn good!


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/

Reply via email to