[Haskell-cafe] How on Earth Do You Reason about Space?

malcolm.wallace malcolm.wallace at me.com
Tue May 31 18:23:25 CEST 2011

ad a) heap consumption is too high for two reasons: firstly, the actual data I
care about is much less than there's data on the heap. Secondly, about half the
heap space is in LAG state. Here are profiles that will illustrate this:

- The first image shows 50% of the heap space being gobbled up with data that
shouldn't be there anymore (LAG)
- The second image shows the types that are in LAG state: ByteString and
HashMap. So, it seems I'm keeping around hash maps?

In Lag/Drag/Void/Use profiling, Lag is actually heap cells that are created too _early_.  (Drag are those that are kept for longer than necessary.)  Lots of Lag generally means your program is too strict - it is forcing structure long before it needs to.  To fix it, you need to make things lazier.  My first suspicion would fall on ByteString.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110531/cf7fb19e/attachment.htm>

More information about the Haskell-Cafe mailing list