So the problem is only with the data structures on the heap that are pinned in place to play nice with C?<div><br></div><div>I&#39;d be curious to understand the change too, though per se pinned memory (a la storable or or bytestring) will by definition cause memory fragmentation in a gc&#39;d lang as a rule,  (or at least one like Haskell).</div>

<div>-Carter<br><br><div class="gmail_quote">On Thu, Sep 20, 2012 at 8:59 PM, John Lato <span dir="ltr">&lt;<a href="mailto:jwlato@gmail.com" target="_blank">jwlato@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<br>
<br>
We&#39;ve noticed that some applications exhibit significantly worse<br>
memory usage when compiled with ghc-7.6.1 compared to ghc-7.4, leading<br>
to out of memory errors in some cases.  Running one app with +RTS -s,<br>
I see this:<br>
<br>
ghc-7.4<br>
 525,451,699,736 bytes allocated in the heap<br>
  53,404,833,048 bytes copied during GC<br>
      39,097,600 bytes maximum residency (2439 sample(s))<br>
       1,547,040 bytes maximum slop<br>
             628 MB total memory in use (0 MB lost due to fragmentation)<br>
<br>
ghc-7.6<br>
512,535,907,752 bytes allocated in the heap<br>
  53,327,184,712 bytes copied during GC<br>
      40,038,584 bytes maximum residency (2391 sample(s))<br>
       1,456,472 bytes maximum slop<br>
            3414 MB total memory in use (2744 MB lost due to fragmentation)<br>
<br>
The total memory in use (consistent with &#39;top&#39;s output) is much higher<br>
when built with ghc-7.6, due entirely to fragmentation.<br>
<br>
I&#39;ve filed a bug report<br>
(<a href="http://hackage.haskell.org/trac/ghc/ticket/7257" target="_blank">http://hackage.haskell.org/trac/ghc/ticket/7257</a>,<br>
<a href="http://hpaste.org/74987" target="_blank">http://hpaste.org/74987</a>), but I was wondering if anyone else has<br>
noticed this?  I&#39;m not entirely sure what&#39;s triggering this behavior<br>
(some applications work fine), although I suspect it has to do with<br>
allocation of pinned memory.<br>
<br>
John L.<br>
<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
</blockquote></div><br></div>