Why "managed memory" doesn't mean "leak-proof" — and why a growing cache can outsmart a garbage collector that is doing its job perfectly.
A lot of developers who learned to program in a garbage-collected language — Java, C#, Python, JavaScript — carry around a quiet assumption: memory leaks are a C problem, something that happens when someone forgets to call free(). Since the runtime handles memory automatically, the reasoning goes, leaks simply can't happen. That reasoning is wrong, and the reason it's wrong is exactly what makes garbage collection worth understanding properly: the collector doesn't free memory that's unneeded. It frees memory that's unreachable. Those are not the same thing, and the gap between them is where every memory leak in a managed-memory language lives.