> > Preloading has nothing todo with shared memory. The idea is to load as
much
> > as possible in the parent process. Now, when a child is forked, all
childs
> > have the same modules loaded. Since Unix only copies the memory when a
write
> > to a memory loactaion takes place, the preloaded modules will actually
share
> > the same memory location, as long as they not write to the memory.
>
> Gerald, are you sure that it works that way? If it's, why top() reports a
> bigger size of the shared memory when more modules were preloaded at the
> server startup?
>

mod_perl_tunning.pod says:

The biggest benefit here is that the child process never needs to
recompile the code, so it is faster to start, and the child process
actually shares the same physical copy of the code in memory due to
the way the virtual memory system in modern operating systems works.

"the way the virtual memory system in modern operating systems works" means
they copy only on write.

There was a discussion about that a long time ago when Vivek started the
writing of mod_perl_tunning pod. I don't know when this actually was, but it
must be more then 2 years ago...

Gerald


> I know that the main idea behind the shared memory is for dynamically
> linked apps, which share freezed text memory segments and not the heap
> memory Perl uses for its compiled code.
>
> Memory management gurus (Vivek? Frank?), will you please step in and
> explain this issue once and forever? There is a lot of confusion goes
> around the "sharing" term. Thanks a million!
>
> _______________________________________________________________________
> Stas Bekman  mailto:[EMAIL PROTECTED]    www.singlesheaven.com/stas
> Perl,CGI,Apache,Linux,Web,Java,PC at  www.singlesheaven.com/stas/TULARC
> www.apache.org  & www.perl.com  == www.modperl.com  ||  perl.apache.org
> single o-> + single o-+ = singlesheaven    http://www.singlesheaven.com
>

Reply via email to