VALGRIND

This is a debugging and profiling tool for Linux-based systems. Think of it as a memory bug detector. It helps ensure programs don't leak memory, don't access invalid memory, and that dynamic memory allocation functions are used safely and correctly.

//installation
root@dev:~$ sudo apt install valgrind

//usage
root@dev:~$ gcc -g myProgram.c -o myProgram
root@dev:~$ valgrind ./myProgram
 Sample Output
 ==12345== HEAP SUMMARY:
 ==12345== definitely lost: 40 bytes in 1 blocks
 ==12345== indirectly lost: 0 bytes
 ==12345== still reachable: 0 bytes
 ==12345== suppressed: 0 bytes
 ==12345== ERROR SUMMARY: 1 errors from 1 contexts

Last updated