Find the answer to your Linux question:
Results 1 to 3 of 3
Is there any command to get the memory utilization of a particular process in Linux? I tried with Top and /proc/pid/status commands but the results are not proper, the memory ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    2

    Question Memory utilization for a particular process

    Is there any command to get the memory utilization of a particular process in Linux?
    I tried with Top and /proc/pid/status commands but the results are not proper, the memory keeps on increasing.

    Can anyone tell other than Top and /proc/pid/status commands ?

  2. #2
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    This will give you the resident set size, the non-swapped physical memory that a task has used, for a process which is in kilobytes

    Code:
    ps -eo pid,rss | grep "<pid> " | awk '{print $2}'
    man ps for details.

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    2
    Hi,

    Thank you for your response.

    "ps -eo pid,rss | grep "<pid> " | awk '{print $2}' "

    Even this command gives the same information as that of Top.

    But problem here is that the information given by top is not reliable it is constanly varying.

    For example if we add some routes in a router the memory utilization increases accordingly for a process and now if the same amount of routes are deleted the memory utilization is not decreasing to the previous value, it is sometimes increasing which is wrong behaviour.

    So my intention is to know the exact memeory allocation and deallocation for a particular process.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...