Christopher Done | 7 May 2012 16:00

Re: Explicit calls to the garbage collector.

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.
Johan Tibell | 7 May 2012 19:28
Picon
Gravatar

Re: Explicit calls to the garbage collector.

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

Gmane