When to run the garbage collector

Simon Marlow simonmar at microsoft.com
Wed Jun 15 07:29:19 EDT 2005

On 14 June 2005 10:35, Robert van Herk wrote:

> I noticed that it is possible to run the garbage collector
> explicitely... 
> Currently, I am writing a stateful webserver, that once in a while
> (e.g. every 30 minutes) can discard a lot of memory (because every 30
> minutes sessions time out and their state can be thrown away).
> Would it be wise to call the garbage collector explicitely, directly
> after this cleanup is done?

Sounds reasonable, otherwise it might be a while before a major GC runs.

In CVS we have a new idle GC feature: the GC is run automatically after
a specified amount of idle time.  This might be useful in your case,
too.  (it is only activated in -threaded mode right now).


More information about the Glasgow-haskell-users mailing list