Re: [racket] Understanding GC when working with streams

2013-09-09 Thread Joe Marshall
Ever? Or for the purpose discussed earlier? On Sep 9, 2013 7:17 AM, "Matthias Felleisen" wrote: > > I wonder whether you really want lazy streams. -- Matthias > > > > On Sep 9, 2013, at 10:19 AM, Lawrence Woodman wrote: > > > On 09/09/13 07:19, Stephen Chang wrote: > >> Konrad's exactly right. Y

Re: [racket] Understanding GC when working with streams

2013-09-09 Thread Stephen Chang
> Thanks, and to Konrad too. You're mention of in-range being more > like a generator, actually makes me wonder whether a generator would > be a better choice for processing large data sets, from databases and > csv files, sequentially. What do you think? On Mon, Sep 9, 2013 at 10:17 AM, Matthia

Re: [racket] Understanding GC when working with streams

2013-09-09 Thread Matthias Felleisen
I wonder whether you really want lazy streams. -- Matthias On Sep 9, 2013, at 10:19 AM, Lawrence Woodman wrote: > On 09/09/13 07:19, Stephen Chang wrote: >> Konrad's exactly right. Your filtered-nums blows up because you named >> the stream and then traversed the entire thing. In general, if y

Re: [racket] Understanding GC when working with streams

2013-09-09 Thread Lawrence Woodman
On 09/09/13 07:19, Stephen Chang wrote: Konrad's exactly right. Your filtered-nums blows up because you named the stream and then traversed the entire thing. In general, if you hang onto the head of the stream while traversing then the GC can't collect anything because since you have a pointer to

Re: [racket] Understanding GC when working with streams

2013-09-08 Thread Stephen Chang
Konrad's exactly right. Your filtered-nums blows up because you named the stream and then traversed the entire thing. In general, if you hang onto the head of the stream while traversing then the GC can't collect anything because since you have a pointer to the head, every element of the stream is

[racket] Understanding GC when working with streams

2013-09-07 Thread Konrad Hinsen
Lawrence Woodman writes: > i. Why does the GC seem to collect more effectively when the stream is > created in a function as opposed to in a straight definition? i.e > test-gen-filtered-nums? passes, although I note that > test-for/sum-gen-filtered-nums? doesn't. I don't

[racket] Understanding GC when working with streams

2013-09-07 Thread Lawrence Woodman
Hello, I'm trying to understand how memory is allocated and collected when working with streams. I recently asked a question about how to limit memory when using streams on Stackoverflow and got two good answers: http://stackoverflow.com/questions/18629188/how-to-limit-memory-use-when-using-a-