Memory Leak
A memory leak is a software defect where an application progressively consumes more memory over time because it allocates memory for operations but fails to release it when it is no longer needed, eventually degrading performance or causing crashes.
Understanding Memory Leak
Memory leaks are insidious because they do not cause immediate failure. The application starts working fine, but over time it slows down, becomes unresponsive, and may eventually crash. Users who keep a web application open in a browser tab for hours, or who navigate through many pages in a single session, are most likely to encounter the effects of memory leaks.
In web applications, common causes of memory leaks include event listeners that are never removed, intervals or timeouts that are never cleared, references to DOM elements that have been removed from the page, and growing data structures that are never pruned. AI-generated code frequently creates these situations because the AI focuses on making features work without always implementing proper cleanup logic.
Memory leaks can be difficult to catch in short testing sessions because the effects accumulate gradually. Testers who spend extended time exploring an application or who navigate through many different pages in a single session are more likely to notice the telltale signs: increasing sluggishness, rising browser memory usage, and eventual unresponsiveness.
Related terms
Learn more
Performance Bug
A performance bug is a software defect that causes an application to run significantly slower than expected, consume excessive system resources, or respond sluggishly, degrading the user experience even though features may be functionally correct.
Read moreBug
A bug is a flaw, error, or defect in a software application that causes it to produce incorrect results, behave unexpectedly, or fail to perform its intended function.
Read moreTechnical Debt
Technical debt is the accumulated cost of choosing quick or expedient solutions in software development instead of better approaches, resulting in code that is harder to maintain, more prone to bugs, and more expensive to modify in the future.
Read more