command to find physical memory details of a process in Solaris

user358232 picture user358232 · Aug 24, 2011 · Viewed 18.4k times · Source

How do I find total physical memory and available physical memory of a process(for e.g. sched process) in Solaris. Are there any commands available? Please provide with an example.

Answer

itilys picture itilys · Aug 25, 2011

To known the total Solaris Available memory use

havoc@h100:~$ prtconf -v|grep Mem
Memory size: 3326 Megabytes

To display "process" memory, you must use the "pmap" command, as man page says display information about the address space of a process

For example, if we have a process id (pid) for PostgreSQL DB (5057), you can check "eXtended" information using the "-x" flag, as

havoc@h100:~$ pfexec pmap -x 5057
5057:   /u01/app/postgres/9.0/db/bin/64/postgres -D /var/postgres/9.0/data
         Address     Kbytes        RSS       Anon     Locked Mode   Mapped File
0000000000400000       5248       3648          -          - r-x--  postgres
000000000092F000         52         52         24          - rw---  postgres
000000000093C000        384         40         12          - rw---  postgres
000000000099C000        536        432        304          - rw---    [ heap ]
FFFFFD7FFE320000        112         24          -          - r-x--  libz.so.1
FFFFFD7FFE34B000          4          4          -          - rw---  libz.so.1
FFFFFD7FFE34D000         12         12          -          - r-x--  libpthread.so.1
FFFFFD7FFE350000        188         44          -          - r-x--  libgss.so.1
FFFFFD7FFE38F000          4          4          -          - rw---  libgss.so.1
FFFFFD7FFE390000          4          -          -          - rw---  libgss.so.1
FFFFFD7FFE3A0000       1612        484          -          - r-x--  libcrypto.so.0.9.8
FFFFFD7FFE543000        144        140          -          - rw---  libcrypto.so.0.9.8
FFFFFD7FFE567000          8          -          -          - rw---  libcrypto.so.0.9.8
FFFFFD7FFE570000        340        132          -          - r-x--  libssl.so.0.9.8
FFFFFD7FFE5D5000         24         24          -          - rw---  libssl.so.0.9.8
FFFFFD7FFE5E0000         36         16          -          - r-x--  libpam.so.1
FFFFFD7FFE5F9000          4          4          -          - rw---  libpam.so.1
FFFFFD7FFE600000       1468        252          -          - r-x--  libxml2.so.2
FFFFFD7FFE77E000         48         48          -          - rw---  libxml2.so.2
FFFFFD7FFE790000        260         64          -          - r-x--  libxslt.so.1
FFFFFD7FFE7E0000          8          8          -          - rw---  libxslt.so.1
FFFFFD7FFE830000         68         48          -          - r-x--  libsocket.so.1
FFFFFD7FFE851000          4          4          -          - rw---  libsocket.so.1
FFFFFD7FFE860000        560        436          -          - r-x--  libnsl.so.1
FFFFFD7FFE8FC000         12         12          -          - rw---  libnsl.so.1
FFFFFD7FFE8FF000         28         20          -          - rw---  libnsl.so.1
FFFFFD7FFE940000         60         48          -          - r-x--  methods_unicode.so.3
FFFFFD7FFE95E000          8          8          -          - rw---  methods_unicode.so.3
FFFFFD7FFE960000       5328        348          -          - r-x--  es_ES.UTF-8.so.3
FFFFFD7FFEEA3000          8          8          -          - rw---  es_ES.UTF-8.so.3
FFFFFD7FFEEB0000        464        288          -          - r-x--  libm.so.2
FFFFFD7FFEF33000          8          8          -          - rw---  libm.so.2
FFFFFD7FFF073000          4          4          -          - rwxs-    [ anon ]
FFFFFD7FFF080000         64          8          -          - rwx--    [ anon ]
FFFFFD7FFF0A0000         64         64          -          - rwx--    [ anon ]
FFFFFD7FFF0C0000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF0D0000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF0E0000         24         20          4          - rwx--    [ anon ]
FFFFFD7FFF0F0000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF100000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF110000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF120000       1664       1560          -          - r-x--  libc.so.1
FFFFFD7FFF2C0000         48         48         24          - rw---  libc.so.1
FFFFFD7FFF2CC000          8          8          8          - rw---  libc.so.1
FFFFFD7FFF2D0000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF2E0000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF2F0000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF300000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF310000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF320000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF330000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF340000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF350000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF360000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF370000          4          4          -          - rw---    [ anon ]
FFFFFD7FFF380000          4          4          -          - rw---    [ anon ]
FFFFFD7FFF390000          4          4          -          - rwx--    [ anon ]
FFFFFD7FFF393000        348        288          -          - r-x--  ld.so.1
FFFFFD7FFF3FA000         12         12          4          - rwx--  ld.so.1
FFFFFD7FFF3FD000          8          8          -          - rwx--  ld.so.1
FFFFFD7FFFDEB000         84         84         16          - rw---    [ stack ]
---------------- ---------- ---------- ---------- ----------
        total Kb      19444       8836        396          -

I hope it will be useful,

Urko,