Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. pgrep apache2 | xargs -n1 -I{} cat /proc/{}/statm | awk '
  2. {size+=$1; resident+=$2; share+=$3; process_count+=1} END {
  3. printf "%.2fn",(resident - (resident/size) * share)/process_count}'
  4.  
  5. /proc/[pid]/statm
  6. Provides information about memory usage, measured in pages.
  7. The columns are:
  8.  
  9. size (1) total program size
  10. (same as VmSize in /proc/[pid]/status)
  11. resident (2) resident set size
  12. (same as VmRSS in /proc/[pid]/status)
  13. share (3) shared pages (i.e., backed by a file)
  14. text (4) text (code)
  15. lib (5) library (unused in Linux 2.6)
  16. data (6) data + stack
  17. dt (7) dirty pages (unused in Linux 2.6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement