One of the objectives of Clojure is to reduce incidental complexity.
And one of the biggest sources of incidental complexity in Clojure was
the retention of the head of a lazy sequence due to its being
referenced by some local (argument or local (let) binding). One might
expect that, if no subsequent code in the body of a function uses that
arg/local, it would be subject to GC. Unfortunately, on the JVM, that
is, in many cases, not true - the local is considered a live reference
and is thus not GCed. This yields the infamous 'holding onto the head'
problem, and subsequent Out Of Memory errors on large data sets.
I had put in place a workaround, which was the 'clearing/nulling-out'
The full solution is to track, during compilation, the lifetime of all
I'm happy to announce I have implemented this fine-grained locals
N.B. that this is strictly a lifetime management issue and does not
If you've got a pet case of incidental head-retention, please try out
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.