logoalt Hacker News

X0Refractiontoday at 9:15 AM1 replyview on HN

What language doesn't allow memory leaks?


Replies

dmytrishtoday at 9:29 AM

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).

show 1 reply