Performance Monitoring On Linux

Have you ever cared about your program perfomance!!.

how does your multi threaded program behaves on high ended boxes ? is it scalable on high end boxes or do u have any lock contention which effects your program scaling factor.

how much resources(memory,CPU) your software needs ?

These factors decide your software fate in market. Not only functionality of your program, but also performance and scalability is the key factor for a software . Now a days SLOW is the word which end users/clients hate .

There are many software's which are functionally good , but when you use them you experience slowness . there are many servers which needs to be rebooted once in a day due to memory leaks.

Let us Optimize our programs/Software/Server to run faster without exhausting the memory.

1) Let us discuss how to monitor your program memory consumption .

there are many open source tools which identifies the memory leaks . one of the award winning tool is valgrind .

here is the link how to use the valgrind:

For Memory leaks:

Valgrind usage for memory leaks

Where to download Valgrind ?

Download Valgrind

For high memory consumption:

Some times there would not be any leaks, but still memory consumption would be high. we would be creating more objects of large size and freeing them. Let us use massif profiler from
valgrind tool .

I will update the massif tool documentation here soon.....

reading core files using GDB

Have your ever seen core files getting created by process on Linux. if you have many process running and in case if you dont know which process has created the core file, you can use GDB.

$ gdb -c core_file . this gives you which process has created the dump file .