Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Mar 1998 10:04:02 -0700 (MST)
From:      Marc Slemko <marcs@znep.com>
To:        Scot Elliott <scot@online.barbour-index.co.uk>
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: Process sizes
Message-ID:  <Pine.BSF.3.95.980308100203.2799a-100000@alive.znep.com>
In-Reply-To: <Pine.BSF.3.96.980227231736.357B-100000@tweetie.online.barbour-index.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Feb 1998, Scot Elliott wrote:

> Hi.  I know this probably belongs to a more general group but Im not sure
> where....
> 
> I just installed PHP v3 on our web server.  Now the apache binary is over
> twice what it was before - fair enough because it's got a lot of extra
> code, right.  The question I have, is weather the OS is clever enough to
> only have one copy of all this code in memory, of whether each apache
> process that is running has its own copy - in which case I'll have to
> consider upgrading the RAM in the machine.  I realise that shared
> libraries only have one coy in memory but I just can't find anything that
> tells me how FreeBSD copes with shared code segments.

Yes, there will only be one copy of most of the code and text pages in
memory.  

There are several methods at work here to allow this.  One of them is copy
on write page mappings; what this means is that when a fork() is done from
the parent process, most pages are marked so that they reference the same
physical memory unless someone tries to write to them, then they get their
own memory.  With Apache, you end up having most of the child pages marked
COW.  There isn't any nice way to figure out exactly how much physical
memory each cihld is using.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980308100203.2799a-100000>