comp.lang.ada
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: How do I free unbounded strings?
Date: 05 Mar 2001 21:14:26 +0100
Date: 2001-03-05T21:14:26+01:00	[thread overview]
Message-ID: <87wva43rdp.fsf@deneb.enyo.de> (raw)
In-Reply-To: mailman.983811905.13183.comp.lang.ada@ada.eu.org

Erik Sigra <sigra@home.se> writes:

> At First Pause the program always uses (880, 880, 776) memory. At Second 
> Pause the program uses at least (888, 888, 780) memory. If I enter a long 
> string this can be for example (900, 900, 784). At Third Pause the program 
> uses exactly as much memory as at Second Pause.
> 
> The memory values are labelled ("Virtual image size of process in Kbytes", 
> "Resitent set size; Kbytes of program in memory", "Shared memory in Kbytes").
> 
> So it appears to me as if freeing doesn't work as the rationale says. Could 
> someone please help me with this?

Well, you can't expect that a program will use operating system
interfaces to allocate individual, small strings.  Usually, memory is
obtained from the operating systems in large chunks which are filled
with smaller objects, and only large objects are directly allocated
via the operating system.

GNAT uses the C malloc()/free() memory management interface, which
might or might not return deallocated memory to the operating system
(of course, a large chunk can only be given back if all the objects in
it have been deallocated).  GNU/Linux systems feature a
malloc()/free() implementation which does return completely unused
chunks.



  reply	other threads:[~2001-03-05 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-05 17:03 How do I free unbounded strings? Erik Sigra
2001-03-05 20:14 ` Florian Weimer [this message]
2001-03-05 21:10   ` Erik Sigra
2001-03-06  1:49     ` Robert A Duff
2001-03-05 20:48 ` Jeffrey Carter
2001-03-05 20:55   ` Erik Sigra
2001-03-06  2:52 ` Mark Biggar
2001-03-06 14:10   ` Larry Kilgallen
replies disabled

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