logoalt Hacker News

dmytrishtoday at 9:29 AM2 repliesview on HN

There are two kinds of memory leaks: forgotten manual freeing (all references are gone, but allocation is not) and forgetting to get rid of references that keeps an allocation alive. Both are a kind of logical error, but the first is mostly possible in languages with manual memory management. The second one is a universal logical error (only programmer knows which live references are really needed).


Replies

ethanpailestoday at 4:49 PM

In the Haskell community I’ve seen the second kind called “space leaks.” I don’t see it used much outside that community but I like the term and use it when talking about other languages as well.

tardedmemetoday at 12:21 PM

Rust allows reference-counting cycles, right?