Re: "ps -o %mem" and free memory in Linux
Victor Sudakov wrote:
> > Perhaps because the php-fpm workers were forked from the same parent
> > and so a lot of theie 'physical' RAM is actually the same RAM as each
> > other, because it's not been modified?
>
> I see your point, but ps(1) talks about real physical RAM:
>
> %mem %MEM ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage. (alias pmem).
>
> If those php-fpm workers share a lot of virtual (?) memory between one
> another, shouldn't `ps` show it as such?
You sum up this:
< php-fpm individual 1><---- php-fpm ---- shared ---->
< php-fpm individual 2><---- php-fpm ---- shared ---->
...
< php-fpm individual n><---- php-fpm ---- shared ---->
You summed up with awk: indivual[1..n] + n * shared
But the real memory sum is: indivual[1..n] + 1 * shared
Do you see the difference?
Regards,
Klaus.
--
Klaus Singvogel
GnuPG-Key-ID: 1024R/5068792D 1994-06-27
Reply to: