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-29 15:03:36 PST Path: newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!howland.erols.net!blackbush.xlink.net!uni-erlangen.de!news-nue1.dfn.de!news-han1.dfn.de!news.fh-hannover.de!news.cid.net!news.enyo.de!news1.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Problems freeing memory with Free Date: 30 Apr 2001 00:16:09 +0200 Organization: Enyo's not your organization Message-ID: <87vgnn5p3q.fsf@deneb.enyo.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: newsfeed.google.com comp.lang.ada:7036 Date: 2001-04-30T00:16:09+02:00 List-Id: 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.