What causes a memory leak?

Answer:
A "memory leak" occurs when memory for an object is allocated on the heap but not deallocated when it is no longer required.

Such memory leaks can eventually lead to out-of-memory errors.
First answer by Ddas-edEn. Last edit by Ddas-edEn. Contributor trust: 45 [recommend contributor recommended]. Question popularity: 3 [recommend question].