I’m looking for a good resource/book to learn about memory leaking in C++.
I use Linux Ubuntu and QtCreator as a IDE ( is there a way to see them there ? ).
I’m looking for a good resource/book to learn about memory leaking in C++. I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What is a Memory Leak?
A memory leak, occurs when a computer program consumes memory but is unable to release it back to the operating system. In C/C++ whenever a program allocates dynamic memory on the heap it should also release the same or it results in memory leak.
In C dynamic memory is allocated on Heap using the function
malloc, the same memory is reclaimed by explicitly calling the functionfree.In C++ dynamic memory is allocated on Heap using the operator
newornew[], the same is reclaimed throughdeleteordelete[].Resources to know more about memory Leaks?
You can find many online tutorials and books to know more about the various common scenarios in which memory leaks are encountered.
Here is one such valuable online tutorial.
How can be memory leak detected?
Various commercial and open source tools are available to detect memory leaks and memory corruptions for various platforms. Since you are specifically asking for Linux platform.
You can use
Valgrindwhich is a very effective memory leak detection tool in Linux.