Profiling and analysing space usage

Bulat Ziganshin bulatz at
Fri Sep 2 12:08:50 EDT 2005

Hello Alistair,

Thursday, September 01, 2005, 6:36:09 PM, you wrote:

AB> The heap profile graph for this program shows an initial peak, and
AB> then the graph is flat at 8Mbytes, which I think is the space
AB> allocated to the two STArrays (2 arrays, 1 million chars each, 4 bytes
AB> per char?). So it looks as though any allocation for the loop function
AB> is GC'd very soon after it's allocated.

Char uses 4 bytes because it must hold any Unicode character, which is
about 1 million :)  use Word8 or CChar

Best regards,
 Bulat                            mailto:bulatz at

More information about the Glasgow-haskell-users mailing list