pmap in Linux

pmap in Linux

Post by Legrandi » Mon, 18 Oct 2004 22:31:37



Hello,

I'd like to measure the amount of RAM required by a single process, but it
turned to be a non-trivial task because of demand paging, dynamic
libraries and fork() usage.

In Solaris it's pretty easy to get what I want using pmap. It shows
the whole application virtual memory and, amongst other things, the RSS
for each region/area.

Unfortunately, this feature has not been implemented in the Linux pmap
port as it just lists region attributes and size, probably because
the info I look for cannot be gathered directly from the /proc dir.

Any hint about this?

Thanks

 
 
 

pmap in Linux

Post by Michael Schnel » Tue, 19 Oct 2004 20:03:03


Quote:

> I'd like to measure the amount of RAM required by a single process,

Not that this would help you finding a value but there is much more to
this:

At a given point of time, maximum on this run, maximum ever possible,
average, minimum, or .... ?

(Minimum usually is 0 as the process can be swapped out completely).

BTW.: The value also depends on the system. E.g. with a non compressed
RAM file system Linux can "load" a process without allocating any
additional RAM for the code pages, as the code already is in RAM.

-Michael

 
 
 

pmap in Linux

Post by Legrandi » Wed, 20 Oct 2004 04:17:58


Quote:>> I'd like to measure the amount of RAM required by a single process,
> Not that this would help you finding a value but there is much more to
> this:

> At a given point of time, maximum on this run, maximum ever possible,
> average, minimum, or .... ?

Right. Those are my final goals. But how could I calculate their values
if I don't know how to get the instantaneous RAM usage?
 
 
 

1. meaning of stack size difference for pmap output and pmap -r output

Subject :- meaning of stack size difference for pmap output and pmap -r
output

Only difference i found was about size of stack(What is the meaning of
size difference)
 15,16c15,16
< FFBEC000     16K read/write/exec     [ stack ]
<  total     1040K
---

If you the meaning abou the size difference please let me know.

Thanks
ramesh
Actual output is given below.

pmap 3333
3333:   -sh
00010000     88K read/exec         /usr/bin/sh
00034000     16K read/write/exec   /usr/bin/sh
00038000     24K read/write/exec     [ heap ]
FF280000    656K read/exec         /usr/lib/libc.so.1
FF332000     32K read/write/exec   /usr/lib/libc.so.1
FF33A000      8K read/write/exec     [ anon ]
FF350000     16K read/exec         /usr/platform/sun4u/lib/libc_psr.so.1

FF370000     24K read/exec         /usr/lib/libgen.so.1
FF384000     16K read/write/exec   /usr/lib/libgen.so.1
FF390000      8K read/exec         /usr/lib/libdl.so.1
FF3A0000      8K read/write/exec     [ anon ]
FF3B0000    120K read/exec         /usr/lib/ld.so.1
FF3DC000      8K read/write/exec   /usr/lib/ld.so.1
FFBEC000     16K read/write/exec     [ stack ]
 total     1040K

pmap -r 3333
3333:   -sh
00010000     88K read/exec         /usr/bin/sh
00034000     16K read/write/exec   /usr/bin/sh
00038000     24K read/write/exec     [ heap ]
FF280000    656K read/exec         /usr/lib/libc.so.1
FF332000     32K read/write/exec   /usr/lib/libc.so.1
FF33A000      8K read/write/exec     [ anon ]
FF350000     16K read/exec         /usr/platform/sun4u/lib/libc_psr.so.1

FF370000     24K read/exec         /usr/lib/libgen.so.1
FF384000     16K read/write/exec   /usr/lib/libgen.so.1
FF390000      8K read/exec         /usr/lib/libdl.so.1
FF3A0000      8K read/write/exec     [ anon ]
FF3B0000    120K read/exec         /usr/lib/ld.so.1
FF3DC000      8K read/write/exec   /usr/lib/ld.so.1
FF3F0000   8192K read/write/exec     [ stack ]
 total     9216K

2. Mouse problem (Have read FAQ)

3. Sherlock linux plug-ins / sherlock for linux?

4. XF86Config timmings for ViewSonic 21

5. List of plug-ins for linux/netscape please!

6. Few basic questions

7. Errors compiling Wingz 1.4 Add-ins (Linux 1.3.99, GCC 2.6)

8. 486 and X Windows

9. Linux and Dial-ins (?)

10. netscape-i686-pc-linux-gnu-installer.tar.gz for Netscape 6.1 ppc?

11. Netscape plug-ins under Linux

12. how to use plug-ins in navigator-linux?

13. Ich m?chte eine Verbindung ins Internet Linux und einer TelesS0 16.3