A certain function that dynamically allocates memory to some object but forgets to deallocate the reserved memory , comsumes some amount of memory every time its is executed.
Thus, a part of the memory disappears with its every run , and eventually the amount of memory consumed has an adverse effect on the system . This situation is known as a memory leak.
MANY POSSIBLE REASON LEAD TO THE SITUATION OF MEMORY LEAKS
1. Forgetting to DELETE something that has been dynamically allocated (i.e using new)
2. Failing to notice that code may bypass a delete statement under certain circumstances .
3. Assigning the result of a new statement to a pointer that was already pointing to an allocated object
Thus, a part of the memory disappears with its every run , and eventually the amount of memory consumed has an adverse effect on the system . This situation is known as a memory leak.
MANY POSSIBLE REASON LEAD TO THE SITUATION OF MEMORY LEAKS
1. Forgetting to DELETE something that has been dynamically allocated (i.e using new)
2. Failing to notice that code may bypass a delete statement under certain circumstances .
3. Assigning the result of a new statement to a pointer that was already pointing to an allocated object