
On 07/05/2012 14:33, Jurriaan Hage wrote:
LS.
I have a very memory intensive application. It seems that the timing of my application depend very much on the precise setting of -H...M in the runtime system (-H2000M seems to work best, computation time becomes a third of what I get when I pass no -H option). I conjecture that this good behaviour is the result of gc happening at the right time. So I wondered: if I can one when is the right time, is it possible then to trigger GC explicitly from within the Haskell code?
It is more likely that you are trading extra memory for better performance, rather than triggering the GC at a good time. GC is basically a space/time tradeoff, see: http://stackoverflow.com/questions/3171922/ghcs-rts-options-for-garbage-coll... If you think the program has points where residency is very low and it would be good to trigger a GC, I would first confirm the hypothesis by doing a heap profile. GC can be triggered with System.Mem.performGC. Cheers, Simon