[Mono-devel-list] Garbage Collection problem

Gonzalo Paniagua Javier gonzalo at ximian.com
Tue Sep 30 22:10:40 EDT 2003


El mié, 01-10-2003 a las 03:30, Jonathan Pryor escribió:
> This is just a guess, but I don't think this is easily solvable.
> 
> Unix platforms use sbrk(2) to allocate additional memory from the
> Operating System.  I don't know of any mechanism to *release* the
> allocated memory back to the OS.
> 
> Once memory is allocated for a process, there is no way (that I know of)
> to release it.
> 
> Thus, even after a garbage collection, the GC heap may be fully
> collected, even empty (i.e. containing no user-allocated objects), but
> without a means for the OS to reclaim space, the actual memory used
> *cannot* decrease.
> 
> Please correct me if I'm wrong.

You can give negative numbers to sbrk.

Btw, malloc can also be based on mmap.

-Gonzalo





More information about the Mono-devel-list mailing list