Memory leak
lastmod 2020-08-31created 2020-08-314 edits
In computer science, a memory leak is a phenomenon in which a computer program keeps occupying memory it no longer needs. When allocated memory is used and then not returned, and this accumulates, memory is wasted. In other words, it occurs when memory allocation is mismanaged so that memory no longer needed is not freed. Some Korean books render the term as "memory loss" (memori sonsil), but since "leak" means more than simply losing something, "leakage" (nusu) is the more accurate rendering.
Important cases
Memory leaks are more serious and should be treated as important especially in the following cases.
- Programs that allocate memory and run for a long time (background tasks on servers or embedded devices)
- When the memory allocation cycle is short (per-frame processing in computer graphics)
- When allocating memory that is not freed even after the program exits, such as shared memory
- When available memory is limited, as in embedded systems or portable devices
- Inside an operating system or memory manager
- When it seriously affects system reliability (device drivers)
- When the operating system does not free memory when the program exits.