Memory leak

In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations[1] in a way that memory which is no longer needed is not released. A memory leak may also happen when an object is stored in memory but cannot be accessed by the running code (i.e. unreachable memory).[2] A memory leak has symptoms similar to a number of other problems and generally can only be diagnosed by a programmer with access to the program's source code.

A related concept is the "space leak", which is when a program consumes excessive memory but does eventually release it.[3]

Because they can exhaust available system memory as an application runs, memory leaks are often the cause of or a contributing factor to software aging.

  1. ^ Crockford, Douglas. "JScript Memory Leaks". Archived from the original on 7 December 2012. Retrieved 20 July 2022.
  2. ^ "Creating a memory leak with Java". Stack Overflow. Retrieved 2013-06-14.
  3. ^ Mitchell, Neil. "Leaking Space". Retrieved 27 May 2017.