Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memory image of process in byte precision 1

Status
Not open for further replies.

softskm

Programmer
Oct 15, 2002
2
IN
Hi
"ps -aux" command gives memory used by process in Kb precision.Is theer any way that I can find memory used by a process in byte precision?
Thanks and Regards
Sanjeev
 
Hi,
take the value and multiply by 1024?

ps -aux | awk '{ /PID/ { print $0 ; next ; } { printf ("%s %s %s %d %s %s...\n", $1,$2,$3,$4*1024,$5 ... ); }

the /PID/ will process the header line. Just count over and adjust the $3, $4 whatever to correspond to the correct filed you want to


Processes can only allocate memory in PAGE chunks ( 4096 or 8192 depending on your machine ). Therefore there is no reason to keep a byte count because there will never be any fractional pages allocated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top