Manually freeing up memory

Marco Leise Marco.Leise at gmx.de
Wed Nov 7 20:50:47 PST 2012


Am Wed, 07 Nov 2012 19:56:35 +0100
schrieb Joseph Rushton Wakeling <joseph.wakeling at webdrake.net>:

> On 11/07/2012 06:53 PM, H. S. Teoh wrote:
> > I think on Posix systems, malloc/free does not return freed memory back
> > to the OS, it just gets reused by the process later on.
> 
> I have to say that in this program, it looks like the memory usage keeps 
> increasing even after the free(), even though theoretically the amount it's 
> possible to free up would dwarf any subsequent memory requirements.

Could it be that you still hold a reference to the raw memory
in your data structures ? A slice would be a typical candidate:
s.name = raw[a .. b];
You probably checked that already...

-- 
Marco



More information about the Digitalmars-d-learn mailing list