I already posted this in another thread, but I think maybe it should have it's own now in light of new information.
If you try to call count on a large lazy sequence you will get an OutOfMemoryError. For example I can evaluate the following expressions on a million line CSV file to reproduce the error. (use 'clojure.contrib.duck-streams) (count (line-seq (reader "big.csv"))) Chouser and I spent some time looking at it. The problem is that not only is count a member function (meaning the implicit variable "this" will hold onto the head), but also the RT.count has local variable o to hold onto the head. Chouser came up with the idea that you could pass the seq in an array allowing you to derefence the pointer to the head of the seq after you've passed it along to a static count method in ASeq. This solution worked for me and you can see my patch at the following url. http://paste.lisp.org/display/71744 Keep in mind I just whipped this up to test Chouser's idea. I'm completely new to the Clojure code base so this is a naive fix at best. I noticed that quite a few classes seem to fall under the IPersistentCollection umbrella so I'm sure the real patch is bigger than this. Also the array only needs to be of size 1, obviously. OK, I'm falling asleep at the computer, I'm sure someone else can roll with this. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---