[Ilugc] How to measure the CPU Usage in linux

  • From: rajasuperman@xxxxxxxxx (Raja Subramanian)
  • Date: Wed Nov 11 14:08:08 2009

On Wed, Nov 11, 2009 at 10:47 AM, Suresh Kumar <sureshkumarr.s@xxxxxxxxx> wrote:

I have developed the small application in linux. I would like to measure the
CPU &memory usage of this application.

tests:
1) CPU Usage of this application
2) Memory Usage of this application

Use the GNU Profiler "gprof" for accurate CPU usage reporting.
There's plenty of documentation online to help you get started.


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)

Memory leaks happen while your program is executing.  Once it
exits, the OS will reclaim all memory back into the free pool.

To debug memory leaks in your app, try Valgrind or Electric Fence.

There are many other tools to choose from:
    http://en.wikipedia.org/wiki/Memory_debugger

- Raja

Other related posts: