Explicit calls to the garbage collector.

Johan Tibell johan.tibell at gmail.com
Mon May 7 19:28:23 CEST 2012


On Mon, May 7, 2012 at 7:00 AM, Christopher Done
<chrisdone at googlemail.com> wrote:
> I would also be interested to know this. A web server is an example of
> a Haskell program that could force garbage collection at the end of
> every request reply, especially a multi-threaded server where the
> memory use is localized to threads. For long-running applications, a
> GC at this point would be nice.

In non-GCed language people often use an arena allocator in situations
like this. However, a semi-space collector (which is what we use) we
get that behavior for free. If your request is processed in less time
than the minor GC cycle, all your data will be dead by the time the GC
run and thus collecting it is free.

-- Johan



More information about the Glasgow-haskell-users mailing list