[Ilugc] How to measure the CPU Usage in linux

  • From: sureshkumarr.s@xxxxxxxxx (Suresh Kumar)
  • Date: Wed Nov 11 14:05:07 2009

Hi Bharathi,

thanks for the response.

How does "time" command helps for measuing the cpu usage?

thanks again.
suresh



Date: Wed, 11 Nov 2009 11:36:36 +0530 (IST)
From: Bharathi Subramanian <sbharathi@xxxxxxxxxxxxx>
Subject: Re: [Ilugc] How to measure the CPU Usage in linux
To: ILUG-C <ilugc@xxxxxxxxxxxxx>
Message-ID:
       <Pine.LNX.4.44.0911111111400.1172-100000@xxxxxxxxxxxxxxxxxxxxxx>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On 10:47am, Suresh Kumar wrote:

No single ans to this Qs.

1) CPU Usage of this application

Try time command.

2) Memory Usage of this application

VSZ in ps or /proc/$PID/status

3) Any memory leakage (measure the free memory before start the
application, measure the free memory after the application ends -
both values should be equal)

4)CPU check --- (Measure the CPU utilization before start the app,
measure the CPU usage after the application ends .....----- both
values should be equal)

It is not the right way. Many processes are running in the system, so
time to time usage may very in small amount and the memory used by the
application may not recollected imdly at the end of execution.

If the application is running for very short time, it is hard to see
the effect of memory leakage. So you should try memory debuggers like
valgrind to analysis the code.

Bye :)
--
Bharathi S

Other related posts: