Is there any way to get just name and VPRVT of running processes?

  • Something like ps -o pid,vsz or are you looking for help running AppleScript to call unix commands? – bmike Mar 11 '13 at 16:20
  • Yes something like that. I tried your code, but all i got was 2 numbers. My AppleScript needs name and VPRVT of every running process. Thanks – Johnnie Mar 11 '13 at 18:20
  • @bmike vsz (vsize / total virtual memory available) is not vprvt (used virtual private memory). top without arguments has columns for both. – Lri Mar 12 '13 at 8:13
  • @LauriRanta you are totally correct. My fishing lessons were quite vague here - more there are several manuals than RTFM. – bmike Mar 12 '13 at 9:48
top -stats command,vprvt -l1 | sed '1,/^COMMAND *VPRVT/d'

-stats = shown columns, -l1 = exit after one sample. It cuts off long command names and uses human-readable sizes though.

  • do shell script "top -stats command,vprvt -l1 -o vprvt | sed '1,/^COMMAND *VPRVT/d'" Thanks Lauri, your code is what i was looking for. I figured out how to sort by vprvt. It could show longer process names too and for some reason, it shows all my running AppleScripts as "applet". – user44948 Mar 12 '13 at 13:10

You could always restrict the columns Activity Monitor shows by right clicking the a column and deselect everything except Virtual Private Memory

screenshot of Activity Monitor

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .