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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fdc38a13551814d X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Allocators and memory reclamation Date: Mon, 28 Jan 2008 23:46:24 +0100 Message-ID: <6074a0F1p7g7gU1@mid.individual.net> References: <4a2fe64e-ae34-4093-88ec-1dc612a9adbd@v29g2000hsf.googlegroups.com> <1d5f87ac-1d82-4d61-9de3-6cb822c69f67@e23g2000prf.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: individual.net 8IEV58p9NOIvGwUkb/KBwg6o46BVT8h48jy769SHLNyAWOyCo= Cancel-Lock: sha1:P/M62Xy9s9efadJRpCQIUJ7lxUg= User-Agent: KNode/0.10.5 Xref: g2news1.google.com comp.lang.ada:19639 Date: 2008-01-28T23:46:24+01:00 List-Id: gpriv@axonx.com wrote: > On Jan 28, 9:53 am, Lucretia wrote: >> On Jan 28, 1:49 pm, Maciej Sobczak wrote: >> >> > "By default, the implementation might choose to have a single global >> > storage pool, which is used (by default) by all access types, which >> > might mean that storage is reclaimed automatically only upon partition >> > completion." >> >> I didn't realise this either. >> >> Luke. > > I think what they mean here is as one allocates memory it will be > requested on the system level. This memory might be only released when > all objects are properly deallocated from the entire pool. However it > seems to be recommendation ("might") and is not what I see with GNAT. > I see memory footprint growing and shrinking as it runs and it is > never deallocating all dynamic objects at any time. GNAT 2007 (at least) ships with two utility storage pools; one which is the global one and other for local allocations that I guess is closer to the behavior Maciej expected: with System.Pool_Local; declare Pool : System.Unbounded_Reclaim_Pool; type IA is access integer; for IA'Storage_Pool use Pool; begin -- Allocate like crazy; end; -- Storage is reclaimed here.