I am using ubuntu 10.04 and i have a program a.c. The valgrind tool suite provides a number of debugging and profiling tools that help you make your programs faster and more correct The most popular of these tools is called memcheck The rest of this guide gives the minimum information you need to start. It is the most common and popular method for finding memory leaks in c C program to detect memory leaks using valgrind the below example demonstrates a simple program that causes a memory leak, and how we can detect it using valgrind.
In this article, we concentrated on memory management framework valgrind and used the tool memcheck (provided by this framework) to describe how it makes life easy for a developer working close to memory. What is a memory leak A process leaks memory when it dynamically allocates memory at run time and forgets about the allocation, never using that memory again This memory becomes a wasted resource as the kernel. Valgrind is a powerful memory profiling tool that can help find memory leaks and invalid memory usage. Improve your c/c++ programming skills and create more stable applications