[Haskell-beginners] Space leak debugging
Philip Scott
haskell-beginners at foo.me.uk
Fri Jun 4 04:12:56 EDT 2010
Hi Daniel,
>
>> It runs forever, which is fine, but it doesn't run in constant space. In
>> fact, it gobbles up all the memory until it can't get any more and dies.
>> I can't for the life of me work out what is going on, surely there is
>> some enormous thunk being built up somewhere,
>>
> Yep.
>
> chunkFiller 0 bs
> ~> chunkFiller (0+1) bs
> ~> chunkFiller ((0+1)+1) bs
> ~> chunkFiller (((0+1)+1)+1) bs
> ~> ...
>
You are entirely right, thank you! I was totally fixated on the
bytestring, I never even considered it might be something to do with my
inncoent looking accumulator :)
You guys are awesome.
- Phil
More information about the Beginners
mailing list