Am 09.09.2012 15:57, schrieb Eldar Insafutdinov:

I ran the tests on 64bit Linux and got the very same results - memory
usage goes up and up.

I just had a thought - could it be a D runtime issue? Because we use a
closure for handling incoming request, it must allocate memory. Is there
a chance that it's not being properly released? Another possibility is
memory fragmentation because there are so many alocations of small
objects happening on every request. I wonder if a custom allocator could
help here at all.

The closure will only use heap allocations if it is a local function and
if it uses variables of the outer function. Delegates to member
functions or normal function pointers converted to a delegate should get
along without any allocation.

For almost all small allocations there is already a pool/free list
allocator in use. The code for this was written during a
profiling/tuning session and is not thoroughly debugged though. So I
suspect something in this area.