Maintainer | dennis@felsin9.de |
---|---|
Safe Haskell | None |
- closureSize :: Num b => a -> IO b
- recursiveSize :: Num b => a -> IO b
Documentation
closureSize :: Num b => a -> IO bSource
Calculate size of GHC objects in Bytes. Note that an object may not be evaluated yet and only the size of the initial closure is returned.
recursiveSize :: Num b => a -> IO bSource
Calculate the recursive size of GHC objects in Bytes. Note that the actual size in memory is calculated, so shared values are only counted once.
Call with
recursiveSize $! 2
to force evaluation to WHNF before calculating the size.
Call with
recursiveSize $!! "foobar"
($!! from Control.DeepSeq) to force full evaluation before calulating the size.
A garbage collection is performed before the size is calculated, because the garbage collector would make heap walks difficult.