comp.lang.ada
 help / color / mirror / Atom feed
From: anon@att.net
Subject: Re: newbie: can't read fast enough... :-)    memory leaks...
Date: Fri, 5 Sep 2014 21:54:07 +0000 (UTC)
Date: 2014-09-05T21:54:07+00:00	[thread overview]
Message-ID: <ludbdu$1ue$1@speranza.aioe.org> (raw)
In-Reply-To: lyr3zqh03t.fsf@pushface.org


But the "free()" from the C-library or OS links does not fully reclaim 
memory and no other program can use this memory until the program ends. 
Unless, that memory is setup as a OS share resource.

That's why I said the programmer needs to modify these routines to add 
Garage Collection (GC), but any GC algorithm will slow the program down.

All of GNAT's memory/storage pools packages and Memory package has its 
pluses and its minuses.  Now, the Global and Local default pools allow 
dynamic allocation without using the Ada attributes. So modifying these 
packages a programmers can add monitor all programs allocations including 
the creation of static variables. While the others pools in GNAT use static 
or stack allocated data and can only monitor it own data.


Now it seams that the map for pools is

  Runtime pools
    Memory
      Pool_Global    --  no automatic reclaim
                     --  default pool for all storage

      Pool_Local     -- handles unbounded reclaim pool
                     -- reclaimed at pool finalization
                     -- uses System.Pool_Global 
                     -- default pool

      Pool_Size      --  stack bounded pool
                     --  reclaimed by normally stack management


  User defined pools
    Memory
      Storage_Pools  --  user defined static pool


  Undefined pools 
    Memory
      Pool_Empty     --  GNAT compiler does reference package

      Remote_Pools   --  comments in GNAT compiler which reference the 
                     --  Implementation Permissions of the
                     --  RM: Remote Call Interface Library Units
                     --  So, package is not included or fully supported 
                     --  in GNAT runtime


  Special pools
    Memory
      Checked_Pools  -- Similar to Storage_Pools with Dereference monitoring
      Debug_Pools    -- Package to help track down memory corruption 
                     -- uses Checked_Pools


In <lyr3zqh03t.fsf@pushface.org>, Simon Wright <simon@pushface.org> writes:
>anon@att.net writes:
>
>> The "Deallocation" routine is normally unfunctional so memory is
>> "reclaimed" during program finalization only.
>
>For GCC 4.9.0, Deallocate (both Pool_Global and Pool_Local) calls
>Memory.Free which calls free().



  reply	other threads:[~2014-09-05 21:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03  9:38 newbie: can't read fast enough... :-) memory leaks gdotone
2014-09-03 10:17 ` Pascal Obry
2014-09-03 10:48   ` G.B.
2014-09-03 15:50     ` Pascal Obry
2014-09-03 17:28     ` Robert A Duff
2014-09-03 17:36       ` Pascal Obry
2014-09-03 19:09         ` gdotone
2014-09-03 19:19           ` gdotone
2014-09-03 19:29             ` Dmitry A. Kazakov
2014-09-03 20:19         ` Robert A Duff
2014-09-03 19:19       ` Dmitry A. Kazakov
2014-09-03 20:31         ` Robert A Duff
2014-09-04  7:18           ` Dmitry A. Kazakov
2014-09-04  4:57   ` Brad Moore
2014-09-04  5:32     ` Jeffrey Carter
2014-09-04  7:23       ` Dmitry A. Kazakov
2014-09-04 14:23       ` Brad Moore
2014-09-04 15:36         ` Brad Moore
2014-09-04 18:28           ` Robert A Duff
2014-09-05  4:58             ` anon
2014-09-05  9:45               ` Simon Wright
2014-09-05 21:54                 ` anon [this message]
2014-09-06  6:28                   ` Simon Wright
2014-09-04 15:55         ` G.B.
2014-09-04 16:43         ` Jeffrey Carter
replies disabled

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