How to calculate CPU and Memory usage of a process in Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dinesh Sivaling
    New Member
    • Dec 2010
    • 4

    #1

    How to calculate CPU and Memory usage of a process in Linux

    Hi everyone,
    I don't know how to calculate cpu and memory usage information of a process.I know this information is located in /proc/pid/... but where.......... ..because i want to display this information in C++ without using "gliptop" library........ ... Please help me ........even if possible i need "top" command source code in Linux...

    Any help is greatly appreciated.... ...
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    Look in the proc directory

    /proc/

    it carries the system information

    Comment

    Working...