Re: Allocators and memory reclamation



gpriv@xxxxxxxxx wrote:

On Jan 28, 9:53 am, Lucretia <lucret...@xxxxxxxxxxx> wrote:
On Jan 28, 1:49 pm, Maciej Sobczak <see.my.homep...@xxxxxxxxx> 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.
.



Relevant Pages

  • Re: Type conversions on pool-specific access types
    ... Which in effect just means that we abadon use of pool-specific access types. ... itself from a global list upon finalization. ... So you have to get a pointer to the object ... But then the actual storage pool of Object_Ptr would not be statically ...
    (comp.lang.ada)
  • Re: Newbie question -- dereferencing access
    ... as it's aimed at experienced programmers. ... that it says "very little about Ada.Finalization, Storage Pool ... to be able to use access types without memory leaks! ... transitioning to Ada is a decreased need for access types thanks to ...
    (comp.lang.ada)
  • Re: Newbie question -- dereferencing access
    ... as it's aimed at experienced programmers. ... that it says "very little about Ada.Finalization, Storage Pool ... You may find that you simply don't need to use access types by using ... the Ada.Containers.* packages. ...
    (comp.lang.ada)
  • Re: Finding out minimal allocation unit
    ... that is automatically called when you allocate or deallocate memory. ... our idea was to build a generic storage pool which can handle ...
    (comp.lang.ada)
  • Re: Ada.Containers and Storage_Pools
    ... enable us to choose more appropriate container types in terms of memory ... would be implemented outside of a storage pool (where it in my opinion ... together and have the storage pool enforce it. ...
    (comp.lang.ada)