Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Relax. It's not pedantry. If I click on a link titled "Memory leak in Ruby" I'm concerned the GC has a problem and I should avoid some particular method call or something else because the GC is currently having trouble collecting something in particular. That would be a memory leak.

The Full Article is talking about handing over data with references to live objects to some library that doesn't let go of those references, it seems. That is a space leak and can and will happen anywhere in any language regardless of whether you're using a perfect GC or not.

So the difference is this:

Ruby has a memory leak -> not my fault, I'll just stop using the offending method that leaks memory, thanks article!

Someone caused ruby to space leak -> duh, it's your fault, no need to write an article about it, you should be letting your references be GC'ed if you don't need them anymore, learn that memory is a scarce resource, etc.

Totally different problems. I was very confused reading the comments here because people are afraid of being called a pedant. Folks, our trade comes with a jargon. If you don't learn it you won't know what you don't know.

Saying simply "unneeded memory is not being reclaimed" is not constructive. Why is it not being reclaimed? Because the reason matters to programmers, we invented different names for those occurrences.



>Saying simply "unneeded memory is not being reclaimed" is not constructive.

Yes it is. It's a description of a problem your monitoring tool has reported that needs investigation.

> Why is it not being reclaimed?

That's the first step of the investigation of the memory leak.


You can have space leaks without memory leaks (if you build up big enough thunks/delayed computations/promises or otherwise run out of heap space) and you can have memory leaks without space leaks (malloc 1 byte and lose its pointer).

It's OK if you don't understand the difference yet - you'll get it eventually - but there is a big difference.


>It's OK if you don't understand the difference yet

Oh I understand the difference. But losing track of memory and accidentally keeping memory in play are both called memory leaks. I would still call it a memory leak if it's due to cyclic references or stale entries in a hash table or other container.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: