I'm probably going to say some of this slightly incorrectly but its mostly correct.
The Kbytes field is the virtual memory usage. You may see cases of Resident being smaller then Kbytes. This is normal.
Resident column means memory that application currently has mapped into physical memory e.g. its really in use.
Shared means how much memory of a segment is ... well ... shared with other application. This is usually executable code from program binaries and shared libraries. Basically means you have one copy of the "thing" in memory and multiple programs map that portion of their address space to that object whatever it is.
Private is an application's private sandbox. This is stuff like heap and stack type stuff.
Say you wanted to figure out how much memory SSH is chewing up on your system - in a warm and fuzzy kinda way.
You could just run pmap on one of you sshd daemon and multiply the Private column by the number of sshd running on your system and then add in the Resident column value ONCE.
OR
You could be a little more specific and run pmap against all the sshd daemons running, add up add the Private columns, and then add in the largest Resident column seen from all the sshd daemons.
You have to be careful though. Stuff like IPC shared memory and graphic adapters onboard memory and the like can show up in a pmap listing for programs. You need to understand this and remove these figures from you calculations.
For instance, Oracle processes will generally show a segment matching about the size of the shared memory segment Oracle is using. You don't want to include this - IMHO. Shared memory should be counted seperately from application memory. I've also seen cases of X servers showing graphic adapter onboard memory as segments. So they look larger then they really are.
There is a tool called memtool you might want to look at as well. Check out the following URL:
http://206.231.101.22/si/tools/memtool/index.php
Obviously a warning - this isn't intended for Production type systems and there is no warrenty on this thing and its not supported by Sun even though it was written by Rich McDougall who works for Sun.
OOPPSSS - typos
Change this:
You could just run pmap on one of you sshd daemon and multiply the Private column by the number of sshd running on your system and then add in the Resident column value ONCE.
To this:
You could just run pmap on one of you sshd daemon and multiply the Private column by the number of sshd running on your system and then add in the SHARED column value ONCE.
And change this:
You could be a little more specific and run pmap against all the sshd daemons running, add up add the Private columns, and then add in the largest Resident column seen from all the sshd daemons.
To this:
You could be a little more specific and run pmap against all the sshd daemons running, add up add the Private columns, and then add in the largest SHARED column seen from all the sshd daemons.
Sorry :)