comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen)
Subject: Re: Problems freeing memory with Free
Date: 30 Apr 2001 08:23:19 -0500
Date: 2001-04-30T08:23:19-05:00	[thread overview]
Message-ID: <pjOxrgMrFAuQ@eisner.encompasserve.org> (raw)
In-Reply-To: slrn9eq5ht.13j.randhol+abuse@kiuk0156.chembio.ntnu.no

In article <slrn9eq5ht.13j.randhol+abuse@kiuk0156.chembio.ntnu.no>, randhol+abuse@pvv.org (Preben Randhol) writes:
> On 30 Apr 2001 00:16:09 +0200, Florian Weimer wrote:
>> randhol+abuse@pvv.org (Preben Randhol) writes:
>> 
>> 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 see. So that explaines why if I delete X of the last nodes it frees
> the memory, while if I free the X first or X in the middle, it may be
> 50_000 nodes or more the size has no influence apparently, it is not
> freed as the OS thinks I still need the memory because the last node is
> still using the memory at a much higher position?

But that is just _typical_ of the way implementations are most often
built.  There is no guarantee regarding when or if memory will be
returned to an operating system by all Ada implementations.



  parent reply	other threads:[~2001-04-30 13:23 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
2001-04-30  7:35   ` Preben Randhol
2001-04-30  8:01     ` Preben Randhol
2001-04-30 13:23     ` Larry Kilgallen [this message]
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