Run Pmap to check the memory used by the process in CentOS.

Source: Internet
Author: User

Run Pmap to check the memory used by the process in CentOS.

Pmap provides memory ing for processes. The pmap command is used to display the memory status of one or more processes. It reports the address space and memory status of the process. Pmap is actually a command on Sun OS. linux only supports its limited functions. However, it is helpful for viewing the complete process address space. We need the PID or the unique process ID of the running process to view the process memory status. We can get it through/proc or conventional commands such as top or ps.

Syntax or usage
#pmap PID 

Or

#pmap [options] PID 

In the output, all addresses, kbytes, mode, and mapping are displayed.

Option
  • -X extended display extension format
  • -D device: Display device format
  • -Q quiet does not display the header/footer line
  • -V: display version information
Memory status of a single process
[root@info ~]# pmap 10131013: /usr/sbin/sshd00110000 1480K r-x- /usr/lib/libcrypto.so.1.0.000282000 80K rw-- /usr/lib/libcrypto.so.1.0.000296000 12K rw-- [ anon ]00299000 36K r-x- /lib/libkrb5support.so.0.1002a2000 4K rw-- /lib/libkrb5support.so.0.1002a3000 16K r-x- /lib/libplc4.so002a7000 4K rw-- /lib/libplc4.so002ab000 88K r-x- /lib/libaudit.so.1.0.0002c1000 4K r-- /lib/libaudit.so.1.0.0002c2000 4K rw-- /lib/libaudit.so.1.0.0002c3000 216K r-x- /lib/libgssapi_krb5.so.2.2002f9000 4K rw-- /lib/libgssapi_krb5.so.2.2002fa000 808K r-x- /lib/libkrb5.so.3.3003c4000 24K rw-- /lib/libkrb5.so.3.3003ca000 152K r-x- /lib/libk5crypto.so.3.1003f0000 4K rw-- /lib/libk5crypto.so.3.1003f1000 92K r-x- /usr/lib/libnssutil3.so00738000 4K r--- /lib/libresolv-2.12.so00739000 4K rw-- /lib/libresolv-2.12.so0073a000 8K rw-- [ anon ]00825000 120K r-x- /lib/ld-2.12.so00843000 4K r--- /lib/ld-2.12.so00844000 4K rw-- /lib/ld-2.12.so0090d000 32K r-x- /lib/libwrap.so.0.7.600915000 4K rw-- /lib/libwrap.so.0.7.600948000 484K r-x- /usr/sbin/sshd009c1000 8K rw-- /usr/sbin/sshd009c3000 20K rw-- [ anon ]009e0000 92K r-x- /lib/libpthread-2.12.so009f7000 4K r--- /lib/libpthread-2.12.sototal 8232K
Multi-process memory status

We can check the multi-process memory by inserting multiple PIDs. Separate multiple PIDs with spaces.

pmap 1013 1217 1118 
Extended process memory
[root@info ~]# pmap -x 10131013: /usr/sbin/sshdAddress Kbytes RSS Dirty Mode Mapping00110000 1480 92 0 r-x- libcrypto.so.1.0.000282000 80 80 80 rw-- libcrypto.so.1.0.000296000 12 8 4 rw-- [ anon ]00299000 36 0 0 r-x- libkrb5support.so.0.1002a2000 4 4 4 rw-- libkrb5support.so.0.1002a3000 16 0 0 r-x- libplc4.so002a7000 4 4 4 rw-- libplc4.so002ab000 88 4 0 r-x- libaudit.so.1.0.0002c1000 4 4 4 r--- libaudit.so.1.0.0002c2000 4 4 4 rw-- libaudit.so.1.0.0002c3000 216 4 0 r-x- libgssapi_krb5.so.2.2002f9000 4 4 4 rw-- libgssapi_krb5.so.2.2002fa000 808 4 0 r-x- libkrb5.so.3.3003c4000 24 24 24 rw-- libkrb5.so.3.3003ca000 152 4 0 r-x- libk5crypto.so.3.1003f0000 4 4 4 rw-- libk5crypto.so.3.1003f1000 92 0 0 r-x- libnssutil3.so00408000 12 12 12 rw-- libnssutil3.so0040b000 12 0 0 r-x- libplds4.so0040e000 4 4 4 rw-- libplds4.so--- --- --- --- ---total kB 8232 - - -

Here the Address, Kbyte, Dirty, RSS, mode and mapping are described as follows:

Extended and device format regions
  • Address: memory start Address
  • Kbytes: the number of bytes in memory (KB)
  • RSS: the number of bytes in the reserved memory (KB)
  • Dirty: number of bytes of Dirty pages (including shared and private ones) (KB)
  • Mode: Memory permission: read, write, execute, shared, private (copy upon writing)
  • Mapping: memory-occupied files, [anon] (allocated memory), or [stack] (stack)
  • Offset: file Offset
  • Device: Device Name (major: minor)

Via: http://linoxide.com/linux-command/pmap-command/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.