Re: Regarding /proc/<pid>/status

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

 



shivaligupta wrote:

Mulyadi Santosa wrote:

Dear shivaligupta

But in the below given example VmSize >> VmLib + VmExe + VmData
+VmStk what does that indicate?

bash-2.05b# cat /proc/16108/status
Name:   thunderbird
State:  S (sleeping)
Tgid:   16108
Pid:    16108
PPid:   4436
TracerPid:      0
Uid:    0       0       0       0
Gid:    0       0       0       0
FDSize: 256
Groups: 0 1 2 3 4 6 10
VmSize:     4156 kB
VmLck:         0 kB
VmRSS:         4 kB
VmData:      108 kB
VmStk:        24 kB
VmExe:       592 kB
VmLib:      1312 kB


As you can see there, VmSize is bigger than the total. Why? Because VmSize represent the size of all allocated VMA. A size of all VMAs doesn't equal to current memory consumption, because the page might not exist there
Then the page will be in swap space.(plz correct me if i m wrong)
How can i know how much memory this process has taken in swap?
I guess that stack and heap will always be in memory. so is it like
that the memory consumed in swap is because of code segment + data segment.


In the other hand, VmData and VmRSS represent pages that do exist in RAM (not swapped to disk and already fetch from backed file, if any). This is usually smaller than the actual VMA size since a program usually just use some portion of the its entire dataset in certain period.


Can nyone tell me the links from where i can get proper info about
memory profiling and memory limiting??


Memory profiling? in kernel space? or user space? In user space, maybe you can use valgring. In kernel space, perhaps you can turn on the kmalloc debugging.

I mean memory profiling in user space. Using valgrind, i can calculate memory used by a particular process. But what will happen in case of shared libraries?
Moreover i dont want to use tools like valgrind. can u suggest something which can be done directly by using system files.

And about memory limiting, I don't understand. You mean something "ulimit" ?
Memory limiting means restricting a process to use only certain amount of memory(either less than that or equal to that) if the process tries to use more memory than that it should exit. i know i can use setrlimit for that. is there any other way out?



PS: Sorry, I send this e-mail using non subscribed account in kernelnewbies. Can you kindly repost this message to the forum, please?

regards


Mulyadi






--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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