
Simon Marlow
Bulat Ziganshin wrote:
and moreover, we should perform compaction immediately when swapping grows. imagine for example algorithm that had 80 mb residency and runs on a machine with 100 mb free. performing compacting GC each time when memory usage grows to 100 mb should be better strategy than waiting for 160 mb usage. of course, concrete calculation whether to start GC or not, is a delicate task, but at least it should be performed on each minor GC
I'd like to urge you to have a go at implementing some of these strategies.
I must admit that I am slightly skeptical to complicated heuristics here, since it seems actual performance would depend a lot on memory manangement policies of the underlying OS. However, I find that setting GHC to use the equivalent of +RTS -Mxxx where xxx is about 80% of physical RAM generally works well. Currently, I do this through a C file reading values from sysconf(), which is a bit cumbersome. A way to set these defaults though the ghc command line would be welcome. -k -- If I haven't seen further, it is by standing in the footprints of giants