I'm not even convinced it's a memory leak. In a GC'd language that would mean a runtime or GC bug. I don't really fully understand what is going on, but it doesn't sound to me like that is what is happening. It sounds like it's just chaining a bunch of objects together and because everything is still accessible it's not able to clean things up. But if everything is accessible, it's not a leak.
(I've heard the term "memory drag" used for objects that could be cleaned up from a program semantic view but aren't, but that aren't actually garbage. Using "memory leak" for that makes it harder to talk about both that and actual memory leaks.)
It sounds like it's just chaining a bunch of objects together and because everything is still accessible it's not able to clean things up.
From my understanding, that's exactly what it is. There seems to be an optimization that can drop unneeded links, but I wouldn't exactly call unoptimized a leak/bug.
My first task at my first job was to find a memory leak in an importer. The importer was caching things in 3 caches, and someone did a copy/paste error and was searching the wrong cache for the object, always failing to find it, fetching it from the database, and then storing it in the correct cache. The correct cache got infinitely large.
And of course there was much arguing over whether to call this a "memory leak" or something else. Shrug, the application was steadily consuming memory and never, ever accessing those objects.
The distinction has major implications for what you look for when diagnosing the problem, how you look and what tools you use, how you fix it, and what part of the program or runtime needs to be fixed.
If you just look at the user-visible effect of it crashing, you might as well call it a null-pointer dereference.
(OK, I'm exaggerating there because an NPD won't gobble up resources used by other programs. But we're on a programming forum for programmers discussing a technically-in-depth blog entry written by a programmer for programmers. This isn't some Guardian article written for a wider audience or something like that. The distinction is important.)
11
u/freebit Oct 12 '17
It's not true. The title is misleading.