httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: NT and modules
Date Wed, 18 Jun 1997 17:07:39 GMT
I'm 99.9% sure freebsd implements copy-on-write semantics for fork(). 
Nothing writes into the executable... so it doesn't get copied.  But I'm
also 99.9% sure that the executable's image in memory is just paged from
disk and shared automatically regardless of who execs it. 

I'd be really surprised to hear otherwise... 

The same is true for solaris, linux, irix, and pretty much everything
else.  This is at least a ten year old feature of unixes -- as soon as
memory managers could support fault-on-write sharing became quite
feasible.  Prior to that there was the sticky bit which implied the
executable wasn't going to dink with its code segment once loaded and so
could be shared. 

Some versions of top actually show you the shared resources.  On each httpd only has 80k unshared data (and there's ~500
of them :).


On Wed, 18 Jun 1997, Randy Terbush wrote:

> > On Tue, 17 Jun 1997, Randy Terbush wrote:
> > > I've been playing around with PAM functionality lately which is 
> > > heavily modulized as dynamic functions. I'll look at this. Memory 
> > > usage for me is getting to be a big problem. This could be a huge 
> > > win.
> > 
> > I don't see how it's a memory win.  Once something is loaded it generally
> > isn't unloaded and consumes memory.  And it consumes a tad bit more memory
> > than it would if statically linked.  Unless your OS is braindead (and I'm
> > pretty sure it isn't) then even statically linked executables share across
> > fork. 
> > 
> > Dean
> I'm currently running nearly 100 lead/parent server processes. I am 
> (perhaps mistakenly) under the impression that binaries linked with 
> shared libs in this case will share memory whereas a statically 
> linked binary will not.
> Am I confused?

View raw message