by tlrobinson · 17y ago · 0 comments
Yes. That means lambdas can be the cause of memory leaks.
As described by Charles Nutter, each lambda in Clojure is an anonymous class in Java. The problem is that classes are never garbage collected. They reside in a special place called the PermGen."
I know very little about Clojure, but that seems like a huge problem for Clojure, and other functional-ish JVM languages. Is it?
I've used Rhino (JavaScript on JVM) extensively, and I don't think it suffers from this.
The individual closures created as code executes are GC'ed like everything else.
Since eval is rather specialized, and everyone recommends it be avoided in "normal" code, this is not a major problem.
Plus, it is fixed.
- Comment from cgrand at the bottom of the article.
I advocate tracking down people from Sun and asking them in a personable, friendly tone of voice to please fix this kind of problem. On their front lawns.