[Mono-dev] Should we replace MemoryStream?

Avery Pennarun apenwarr at gmail.com
Mon Nov 9 14:50:33 EST 2009


On Mon, Nov 9, 2009 at 2:48 PM, Miguel de Icaza <miguel at novell.com> wrote:
> Avery wrote:
>> Probably stupid question: why is a compacting garbage collector
>> actually needed?  C programs have survived for a *long* time without
>> any ability whatsoever to compact memory, simply by carefully
>> optimizing their allocation algorithms to avoid fragmentation.  Is the
>> mono allocator very non-optimal in this respect?
>
> Long running applications tend to have this problem.
>
> Either people ignore the problem, or they come up with some creative
> solutions, and the solutions are all over the map.
>
> In some cases, for long running processes, people split work into
> separate processes and recycle the processes (for example Apache) in
> other cases, they use custom memory allocation, pre-allocated pools, or
> mark/release pools.

Thanks for the response.  That makes sense to me.  Short answer:
everybody has this problem, but it's only solvable in the general case
when you have GC and compaction.

Thanks :)

Avery


More information about the Mono-devel-list mailing list