Technology Fundamentals

Memory Leak

Definition

A memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in such a way that memory which is no longer needed is not released. In object-oriented programming, a memory leak may happen when an object is stored in memory but cannot be accessed by the running code.

Why It Matters

Memory leaks cause an application to consume more and more memory over time. Eventually, this can exhaust the available memory, causing the application or the entire system to slow down, crash, or become unstable.

Contextual Example

In a web application, if a developer keeps adding items to a list but never removes them, even when they are no longer needed, the list will grow indefinitely, consuming more and more memory. This is a memory leak.

Common Misunderstandings

  • Garbage-collected languages (like JavaScript) are not immune to memory leaks. Leaks can still occur if unnecessary references to objects are kept.
  • Finding and fixing memory leaks can be a difficult and time-consuming process.

Related Terms

Last Updated: December 17, 2025