Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] top command: meaning of 'm' in memory related values?



Hector Akamine writes:

 > I guess the total memory used by apache is not 42 MB*the number of
 > processes, but less than this as there is some overlap (for shared
 > libraries, etc)

See SHR for explicitly shared objects.

However, Linux implements copy-on-write sematics AFAIK, which means
that for pages of pure code (ie, no globals, no self-modifying code)
the same page is used for all of them, vastly increasing the
probability that the page doesn't get swapped.  Also, pages of global
configuration data may also never be written by children of the
original process, in which case again the same page is used and likely
to remain in memory.  If the kernel is really smart it could keep a
refcount for the page, and avoid evicting pages with high refcounts.

So the answer is, "who knows how much space is actually used?  you
won't know until you're blindsided by the OOM-killer."

Jim B and others may have a better answer, but that's mine. :-)



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links