comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: Problems freeing memory with Free
Date: 30 Apr 2001 00:16:09 +0200
Date: 2001-04-30T00:16:09+02:00	[thread overview]
Message-ID: <87vgnn5p3q.fsf@deneb.enyo.de> (raw)
In-Reply-To: slrn9eouh2.23n.randhol+abuse@kiuk0156.chembio.ntnu.no

randhol+abuse@pvv.org (Preben Randhol) writes:

> I have made a double linked list which seems to preform correctly using
> a debugger. The problem however is that if I delete all the Nodes except
> the last and at the same time look at the programs memory usage with
> "top" under Linux, it reports the same amount of memory all the time. If
> it then delete the last node too, the memory suddenly drops down to the
> expected value (that is same as before the nodes were made). 

There's no error.  A typical implementation of a storage pool
retrieves memory in large chunks from the operating systems and
allocates several objects in each chunk.  When the objects are freed,
a chunk can only be returned to the operating system if all objects
which had been allocated in it before have been freed (unless you've
got a compacting garbage collector, but that's another story).

I think we discussed this phenomenon just a few months ago.



  reply	other threads:[~2001-04-29 22:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-29 20:29 Problems freeing memory with Free Preben Randhol
2001-04-29 22:16 ` Florian Weimer [this message]
2001-04-30  7:35   ` Preben Randhol
2001-04-30  8:01     ` Preben Randhol
2001-04-30 13:23     ` Larry Kilgallen
2001-05-01 12:30     ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox