From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,466b8f87784a3756 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-30 05:23:23 PST Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!iad-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!kilgallen From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: Problems freeing memory with Free Message-ID: References: <87vgnn5p3q.fsf@deneb.enyo.de> Organization: LJK Software Date: 30 Apr 2001 08:23:19 -0500 NNTP-Posting-Host: 216.44.122.34 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 988633401 216.44.122.34 (Mon, 30 Apr 2001 12:23:21 GMT) NNTP-Posting-Date: Mon, 30 Apr 2001 12:23:21 GMT Xref: newsfeed.google.com comp.lang.ada:7044 Date: 2001-04-30T08:23:19-05:00 List-Id: In article , 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.