

Memory leakage is by no means unique to embedded systems, but it becomes an issue partly because targets don't have much memory in the first place and partly because they often run for long periods of time without rebooting, allowing the leaks to become a large puddle.Buffer overruns-caused by writing past the end of a block of allocated memory-frequently corrupt memory.Leaks can obviously be caused by a malloc() without a corresponding free(), but leaks can also be inadvertently caused if a pointer to dynamically allocated memory is deleted, lost, or overwritten.A memory leak occurs when memory is allocated but not freed when it is no longer needed.Memory is allocated on demand-using malloc() or one of its variants-and memory is freed when it’s no longer needed.In this process I use different tools in real time environments to detect memory leaks and then report it to the responsible developers. I work for an application which is memory intensive so it is my job to make sure other processes are not eating up the memory unnecessarily.

So it is always healthy to keep monitoring the memory usage of critical process. As a developer we often face scenarios when proess such as httpd apache, java starts consuming high amount of memory leading to OOM (Out Of memory) situations.

In this tutorial I will share different methods and tools to detect and find memory leaks with different processes in Linux.
