You reproduced it for sure -- On Dec 6, 5:58 pm, MikeM <[EMAIL PROTECTED]> wrote: > Next, I tried this (since your app filters the seq from a map): > > (defn splode2 [n] > (with-local-vars [doc-count 0] > (doseq [document (filter #(= % 1) (map inc (range n)))] > (var-set doc-count (inc @doc-count))) > 'done)) > > and it blows up (out of memory) with (splode2 10000000)
I went ahead and dug around through the heap again, and found it's exactly the same thing that's holding on to all the memory, so this is definitely the same problem. I also saw your subsequent example which uses a different anonymous function which does NOT blow up, and that's very interesting. I'm not sure why this would be, but it seems that filter ends up holding on to the collection its filtering internally from the point at which it first matches - I think the second one doesn't blow up because it doesn't happen until almost the end. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---