On 2014-05-23 2:08 PM, Chris wrote:
Fair enough. But what about programs that allocate a lot and run for
ages (a server app for example)?

A server app? Couldn't have asked me for a better example.

You can see my native events fork here (I'm working on replacing libevent):

https://github.com/globecsys/vibe.d/tree/native-events/source/vibe/core/events

I actually need to improve the GC because of this and a cache library I'm making for vibe.d:

https://github.com/globecsys/cache.d

If you have 10,000 connections, they each create a 64KB buffer in the GC and if you don't want to risk collection for every one in a few times a new connection comes in, you need to use some sampling. Using FreeLists and manual memory management is a bad idea because if you're going to need to copy segments into the GC anyways if you want to extend the lifetime of data received over the network.

I have to create a copy of that data serialized because of manual management. I could store just a pointer if I didn't need to go around the GC which loses 95% of its time collecting absolutely nothing.

Reply via email to