How do I check for memory leaks? (Valgrind etc.) using C.

–1 vote
asked Jun 8 by Khalid Ayaz Khan (110 points)
How do I check for memory leaks? (Valgrind etc.) using C.

1 Answer

0 votes
answered Jun 9 by xDELLx (870 points)
one of most basic things you could do is always check the memory usage (when prog is running) from system monitor(linux top command) ,windows task manager or other tools

If you find the memory usage is always increasing as the execution of prog proceeds, it may have a leak.

Here you can use tools like valgrind this link explains commands valgrid uses & other basics of valgrind (http://cs.ecs.baylor.edu/~donahoo/tools/valgrind/)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...