Re: Memory usage when iterating over lazy sequences

2008-11-01 Thread Rich Hickey
On Oct 31, 4:58 pm, Mark Triggs <[EMAIL PROTECTED]> wrote: > On Oct 31, 1:57 pm, Mark Triggs <[EMAIL PROTECTED]> wrote: > > > When I ran my code it very quickly ran out of memory and fell over. > > After thinking about it for a while I've realised it must be because my > > 'do-something' functio

Re: Memory usage when iterating over lazy sequences

2008-10-31 Thread Mark Triggs
On Oct 31, 1:57 pm, Mark Triggs <[EMAIL PROTECTED]> wrote: > When I ran my code it very quickly ran out of memory and fell over. > After thinking about it for a while I've realised it must be because my > 'do-something' function call is hanging on to the head of the list, so > as its elements are

Memory usage when iterating over lazy sequences

2008-10-31 Thread Mark Triggs
Hi all, I'm just getting started with Clojure, and I've got a bit of a beginner's question regarding memory usage of lazy sequences. I have an array of data that is too big to fit in memory, so I thought I would be clever and process it in manageable-sized chunks. My instinct was to do this usi