Memory Leaks Outlast RAII, GC, and Rust Because Runtimes Can't Judge Intent
A developer who waits for a language or GC to make memory leaks impossible will keep waiting: the remaining leaks live in cache and lifecycle code where the program cannot infer intent. Retention policy, ownership direction, and eviction rules are explicit design decisions, not compiler features.
RAII, garbage collectors, and Rust's ownership model have eliminated a large class of accidental leaks: a C++ pointer lost before `free` becomes an automatic drop at scope exit. A second class remains. Java's GC can trace reachability, yet a static cache can hold 1 MiB arrays the program will never use again; a Kotlin image cache raises the same issue in business terms. When should an entry die? After 10 seconds, after 100 MB, when the page closes, or never? The answer is a business judgement.
Rust does not close the gap. Two `Rc` nodes referencing each other form a cycle whose strong reference counts never hit zero, so destructors never run; `Weak` only helps when the programmer already knows which edge should not own. Rust also permits `std::mem::forget`, and memory leaks sit outside its memory-safety guarantees.
The theoretical limit is the halting problem: knowing whether a reachable object will be used again can require knowing whether a loop terminates. No allocator, compiler, or GC can answer "how long should this object live" in general. Current tooling solves forgotten frees, dangling pointers, and unreachable garbage, but not useless-but-reachable objects or guaranteed bounded memory growth; those decisions belong to cache strategy and resource budgets.
The halting-problem framing keeps the discussion honest: it does not claim all leaks are undetectable, only that a universal detector for arbitrary programs is impossible. Targeted analysis and language constraints still catch many leaks.
Rust's safety guarantee is narrower than the language is often marketed as: `Rc` cycles and `std::mem::forget` are legal, and leaks sit outside the memory-safety promise, so ownership alone is not a final answer.
Deciding whether an object should still exist turns memory management into product design. Cache eviction, retention windows, and resource budgets are business calls, not allocator features.