[Haskell-cafe] Battling laziness
simonmar at microsoft.com
Fri Dec 16 10:47:31 EST 2005
On 16 December 2005 15:23, Joel Reymont wrote:
> Looking at http://wagerlabs.com/randomplay.hd.ps I see closures
> (constructors?) in this order
Ok, so your heap is mainly full of (a) thunks generated by something in
Script.Array, (b) Word8s, and (c) Ints.
> This tells me it's something having to do with array code. I'm
> attaching the Script.Array module at the end. This report does not
> tell me who is retaining the data, though.
> Looking at http://wagerlabs.com/randomplay.hy.ps I see types ordered
> like this
interesting... Word8 and Int correspond to the -hd output above, but '*'
indicates that the type of the <Script.Array.sat_s46N> is polymorphic.
Completely polymorphic closures like this are usually (error
"something"), which is a silly thing to fill up your heap with :-)
I'm a bit mystified though, because looking at the code for
Script.Array, all your arrays are unboxed, so I don't know where all the
Word8s and Ints are coming from. It might be useful to do "+RTS
-hyWord8 -hc" to see who generated the Word8s. Oh, and it looks like
you aren't doing -auto-all, that would probably be helpful.
More information about the Haskell-Cafe