@Mat
Are you talking about unexpected memory usage or actual leaks? The two cases you listed aren't exactly leaks; they are cases where objects stick around longer than intended.
There is no effective difference between the two. Memory that is no longer useful, and remains uncollected is effectively leaked.
That's true from that perspective, but if there is an actual leak that isn't based on properly making references go out of scope appropriately, that's fundamentally different from forgetting which references to your objects are still alive.
If you let a disposable reference go out of scope without calling dispose()
, then you've potentially leaked unmanaged resources. These can sit unclaimed for an arbitrary amount of time (potentially until your program closes). I consider that a memory leak.
Not to be argumentative, but without any context, it doesn't matter. And that particular post is treating memory leak as a global problem, not a localized one. (You can also argue that memory problems are global problems, but you're arguing about something I'm not.)
I don't understand your distinction between global and local problems, nor do I understand why you're even bringing this up. The post I linked is talking about how application behavior (caching) can lead to unexpected behavior (memory leaks). I don't understand what this has to do with any global/local distinction.
Anyways, to rephrase my point, talking about memory leaks is pointless without talking about the types of memory leaks. In this case, it should probably be memory leaks you can fix and memory leaks you can't fix.
Talking about memory leaks you can't fix seems to be a waste of time. If you discover a memory leak that you cannot fix, then the appropriate thing to do is file a bug report, not argue about how to categorize it.