Re: VmSiZE to physical memory mapping

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

 





On 4/12/06, kernel learner <kernellearner@xxxxxxxxx> wrote:
Thanks for your response but i have lots of doubts regarding this:

1. As far as i know VmRSS = (VmSize - swap space being used by the process)
I know on my system there is no swap space
so, VmSize should be equal to VmRSS but that is not the case here. So, what is that extra memory being shown in VmSize?


This doubt is clear now from your mail with subject "Re: Re: Regarding /proc/<pid>/status"


2. VmRSS is physical memory being used by the system.
Now, in case of shared libraries the space used by library will be added in VmRSS of all the processes which are loading it or only to one process.
If to all process then

parameter(A) + parameter(B) + parameter(C) + parameter(D) +
parameter(E) = (MemTotal - MemFree)
wont be satisfied.

3. free gives me the below shown output:

                       total         used         free       shared      buffers
  Mem:       502180       424100        78080            0          340
  Swap:            0            0            0
  Total:       502180       424100        78080

Already a lots of processes are running on my system.  Is it buffers = 340 KB memory being used by page cache etc and remaining ie 512MB(524288 Kb) - 340 KB = 523948 KB should be shown as total (which is not matching here....???)

4. Can you tell me any fuction in C which returns the info as shown in /proc/$PID/status file?
Basically i need mem usage of that process.
I tried getrusage() function. it return 0  for both  usage.ru_maxrss and usage.ru_ixrss


Regards


On 4/12/06, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx > wrote:
Hi...

Allow me to share my (lousy) knowledge
> What parameter should i use for these five processes such that
>
> parameter(A) + parameter(A) + parameter(A) + parameter(A) +
> parameter(A) = (MemTotal - MemFree)
>
you mean:
parameter(A) + parameter(B) + parameter(C) + parameter(D) +
parameter(E) = (MemTotal - MemFree)

What you need is RSS (resident set size) property of each process. This
RSS field represent the size of physical memory consumed by individual
process.
  |  But, you must realize that memory is not consumed only by process.
Buffers and page cache (buffers is also a part of page cache, though)
also eat your RAM. You can use "top" or "free" to check it. So "free"
here actually means "RAM area that is still not allocated for any
purpose".

Feel free to ask again if you need more information.

 

regards,

Mulyadi




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux