April 30, 2011

Finding the memory usage of a process

I recently needed to figure out how to determine the memory usage of a process so I could log it over time. I used the following command to accomplish this.

mike@shiner $ ps -p 7557 -o pid,vsz,rss
  PID      VSZ    RSS
 7557  1983664 298536

You'll need to replace '7557' with the process id you're investigating. The meaning of 'VSZ' and 'RSS' is copy and pasted here from the man page:

     rss        resident set size
     vsz        virtual size in Kbytes (alias vsize)

'RSS' represents the amount of memory resident in RAM. The rest of the memory is held in swap space or the filesystem. 'VSZ' is the amount of virtual memory allocated to the process.

1 comment:

  1. The King Casino
    The king communitykhabar casino in Oklahoma offers casinosites.one a septcasino wide variety https://vannienailor4166blog.blogspot.com/ of games. The goyangfc.com casino offers several slots, poker, blackjack, and live games to choose from. We will also

    ReplyDelete