Size of UArrays
tomasz.zielonka at gmail.com
Wed Mar 30 10:49:38 EST 2005
On Wed, Mar 30, 2005 at 06:41:02PM +0200, Andreas Marth wrote:
> I would like to know how big an "UArray (100,100) Double" is (approximately)
> in Bytes.
I guess you mean:
(accumArray const 0.0 ((1, 1), (100, 100)) ) :: UArray (Int, Int) Double
It should take about 100 * 100 * 8 = 80000 bytes .
> And how much heap will the program consume for it.
> (I mean does the garbage collector need this size, or double the size, or what?)
About the same. I just checked that GHC allocates it as a big object, so
the array isn't copied during GC.
More information about the Glasgow-haskell-users