View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12829 Members
Join this group to post and comment.
Raviteja.g
Raviteja.g • Nov 2, 2008

How to caluculate memory

How to caluculate memory taken by a program during its execution.
is there any system command in the unix os
sriramchandrk
sriramchandrk • Nov 3, 2008
If the program is still running

use this command:
ps -eo vsz -o fname |grep
Example to see size for snmpd (SNMP Daemon)

$ps -eo vsz -o fname|grep snmpd
8592 snmpd

The first column will give you SIZE, according to manual
SIZE is the virtual
size of the process (code+data+stack).
If the program ends even before you can do anything, try this
Press ^Z when the program starts.
Now the program is in stop state, you could run your ps command to see how much your process uses.
Once you are done use 'fg' command to resume the stopped process.


Thanks & Regards
Sriram
anuragh27crony
anuragh27crony • Nov 3, 2008
hmm... nice reply... thanks for information ...sriram :smile:
sriramchandrk
sriramchandrk • Nov 3, 2008
anuragh27crony
hmm... nice reply... thanks for information ...sriram :smile:
Thanks Anurag
Raviteja.g
Raviteja.g • Nov 4, 2008
thanks for reply

Share this content on your social channels -