Section: IT & Technology · Operating SystemsDifficulty: Medium

Memory Leak

USUK

A bug where a program allocates memory but fails to release it, causing gradual resource exhaustion.

Definition

A memory leak occurs when a program allocates heap memory but loses the reference to it without releasing it back to the operating system or runtime, causing memory consumption to grow continuously. Over time, leaked memory reduces available resources, degrades performance, and can crash the application. In languages with manual memory management (C, C++), leaks result from missing free() calls; in garbage-collected languages (Java, Python, JavaScript), leaks occur when objects are unintentionally held in scope preventing collection.

Example

A Node.js server processes thousands of requests per hour but never clears event listeners attached to request objects; after 12 hours, heap memory grows from 200MB to 2GB, causing out-of-memory crashes.

Synonyms

  • memory accumulation
  • heap leak
  • resource leak
  • unfreed memory

Antonyms / Opposites

  • garbage collection
  • memory cleanup
  • proper deallocation

Images

CC-licensed · free to use
More on Wikimedia
Loading images…

Video

  • garbage-collection
  • virtual-memory
  • process
  • thread

Dictionary Entry

Back to IT & Technology