On Mon, 2006-03-13 at 12:47 +0000, Simon Marlow wrote:

> > Am I right in thinking that ghc's rts can free memory back to the system
> > when the heap pressure reduces (at least if it's doing a compacting GC)?
> 
> No, not at the moment.  One thing we planned to do but never got around 
> to is to use madvise() to improve swapping behaviour when memory is 
> tight (see the thread that Bulat refferred to).
> 
> > In this case if it can do so, it should be quite dramatic. It'd ought to
> > be able to go from 400Mb back down to just a few Mb or so.
> 
> Yes it ought to.
> 
> A related problem is that the block allocator is really stupid.  It 
> makes no attempt to reduce fragmentation, and in fact freeing blocks is 
> O(n) because the freelist is kept sorted in address order.  This isn't 
> usually an issue, although it has been reported to be noticeable with 
> very large residencies (500M+).  It's on my list to fix at some point.
> 
> I mention this because freeing all that memory might not be possible if 
> it is highly fragmented.

Ah, I hoped that if we were using the compacting GC then it might be
able to defragment (since it is copying anyway) and thus free large
contiguous blocks, eg munmap()ing whole MBlocks.

Duncan

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to