[comp.lang.ada] Implicit garbage collection in Ada systems

dritz@ANTARES.MCS.ANL.GOV (01/03/91)

In a chapter that I am writing for a book, I would like to say that, whereas
Ada permits implicit garbage collection, not a single implementation of Ada
has it.  Is that correct, as far as you know?  (I mean fully general and
complete garbage collection, not just the freeing of the collection associated
with an access type when the scope of the type's declaration is exited.)

Actually, I need to say only that implicit garbage collection is not routinely
implemented, which is certainly true.  Such a statement justifies the strategy
chosen for a problem solution demonstrated in the chapter.  For added effect,
I would like to make a stronger statement.  I could hedge and say that I am not
aware of an Ada system that implements implicit (i.e., automatic) garbage
collection.  Can I do better and accurately say that no Ada system implements
it?  Does anyone know of a counterexample?

Ken Dritz
Argonne National Lab
dritz@mcs.anl.gov

eachus@linus.mitre.org (Robert I. Eachus) (01/05/91)

     A very hard question to answer for two reasons.  First, no one
would want an Ada compiler which used garbage collection for
everything, and most compilers do some garbage collection (but leave
compaction to the operating system).  Let's try to qualifiy your
question as follows: Does any Ada compiler provide a data type (or
class of data types) for which accessability is tracked and automatic
garbage collection and compaction are provided?  Oops! Task types in
many compilers fit this category.

     The second reason is that there are Ada compilers for several
systems where garbage collection is normally a function of the
operating system: Symbolics, Rational, Intel 432 (High Integrity
Systems), etc.  Also some embedded compilers provide for user
implemented run-times which could transparently provide garbage
collection.

     My guess is that the Symbolics implementation is probably a
sufficient counterexample to encourage you to use the milder sentence.
(Even though it can be argued both ways.  Please! No flames, I'm just
trying to say that question is not subject to a yes or no answer.)


--

					Robert I. Eachus

with STANDARD_DISCLAIMER;
use  STANDARD_DISCLAIMER;
function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...

saharbaugh%roo.dnet@WINNIE.BERKELEY.EDU (01/08/91)

 On 2 Jan 91 Ken Dritz writes:
-In a chapter that I am writing for a book, I would like to say that, whereas
-Ada permits implicit garbage collection, not a single implementation of Ada
-has it.  Is that correct, as far as you know?  (I mean fully general and
-complete garbage collection, not just the freeing of the collection associated
-with an access type when the scope of the type's declaration is exited.)
-
-Actually, I need to say only that implicit garbage collection is not routinely
-implemented, which is certainly true.  Such a statement justifies the strategy
-chosen for a problem solution demonstrated in the chapter.  For added effect,
-I would like to make a stronger statement.  I could hedge and say that I am not
-aware of an Ada system that implements implicit (i.e., automatic) garbage
-collection.  Can I do better and accurately say that no Ada system implements
-it?  Does anyone know of a counterexample?

     Yes, we have a heap management system called HeapGuard (tm) which 
was invented to allow full-Ada to be used in hard real-time systems.  It is 
based on a management scheme that manages memory so that garbage 
collection is never needed.  HeapGuard can be implemented totally in 
software or can be included in a RAM memory board.  We have 
implemented it totally in software in a Verdix Ada Run-Time Environment 
on a Silicon Graphics computer system.  We have also implemented 
hardware support for HeapGuard in a custom built memory board on the 
VME bus of the Silicon Graphics computer.  
     The total software system consists of an Ada Fuzzy Expert System 
(AFES) with flight planning rules as the application.  AFES continuously 
creates "new" objects of various size on the heap and some time later 
"deallocates" them and the ARTE tells HeapGuard to allocate and deallocate 
them and the whole thing runs and runs without stopping for garbage 
collecting.
     As you can probably see I am being protective of how it works; 
however, we are looking for a real system on which to apply it.  Please 
contact me if you have an application on which it might be applicable..Since 
the research was sponsored by the Air Force there is no royalty for use on a 
Government project.  

sam harbaugh
Integrated Software, Inc.
1945 Palm Bay Rd #7
Palm Bay, Florida 32905
(407) 984-1986     fax (407) 951-4291
-------------------------------------

firth@sei.cmu.edu (Robert Firth) (01/08/91)

In article <9101072017.AA03865@winnie.fit.edu> saharbaugh%roo.dnet@WINNIE.BERKELEY.EDU writes:

>sam harbaugh
>Integrated Software, Inc.
>1945 Palm Bay Rd #7
>Palm Bay, Florida 32905
>(407) 984-1986     fax (407) 951-4291

>     Yes, we have a heap management system called HeapGuard (tm) which 
>was invented to allow full-Ada to be used in hard real-time systems.

I'm not going to give details either, but Sam was kind enough to
show me HeapGuard on a recent visit to sunny Florida.

For a program to use it, certain minor conditions have to be met, but
the bottom line is that it allows a transaction-processing system to
run forever (ie without storage fragmentation or other entropic
degradation), and to do so with bounded performance and with bounded
storage requirements.

In many applications, it is just as important that an application
be able to run indefinitely without degradation as that it be able
to meet deadline and resource constraints.  If you have that kind of
problem, I'm strongly recommend you look at HeapGuard.

Robert Firth

saharbaugh%roo.dnet@WINNIE.BERKELEY.EDU (01/10/91)

On 8 Jan 91 Robert Firth writes, in part:
-For a program to use it, certain minor conditions have to be met, but
-the bottom line is that it allows a transaction-processing system to
-run forever (ie without storage fragmentation or other entropic
-degradation), and to do so with bounded performance and with bounded
-storage requirements.

     Thank you Robert for the succinct and eloquent summary.

On 8 Jan 91 Jerry Callen writes:

-Well, let's not be so coy, fellas! :-) It sounds as if a patent
-application or other obstacle is preventing you from saying more,
-but The Perfect Heap Manager is kind of a holy grail, and _I_ would
-love to know more. 

-In particular, just WHAT restrictions have to be placed on the
-application? Hey, I can prevent fragmentation, too, if all the
-allocated objects are the same size. :-)

--- Jerry "you've piqued my curiousity" Callen
-   jcallen@encore.com

    Truly, I am not trying to be coy, just cautious.  You guessed it, there is 
a patent application involved.  For now we are having people sign a non-
disclosure form so that we have some form of containment.

    The HeapGuard scheme is based on two premises, 1) The heap size is 
derated by a certain amount and 2) a certain allocation scheme is used.  If 
the user asks for a heap of size N then HeapGuard reserves a heap of size 
larger than N and as long as the user never tries to use more than a total of 
N at any time the user may allocate and deallocate objects of size 1..N and 
never experience heap overflow or garbage collection.  

     The HeapGuard scheme can be implemented totally in software, which 
we have done.  The amount of unused memory can be greatly reduced 
with the support of special hardware memory addressing circuits, 
especially when the heap space can be handled in blocks (say 16 Bytes).  
We have had such a board designed and built and it is running.

     The HeapGuard algorithm was verified by simulation and Larry Koos 
of Koos Technical Services, who designed the board circuits, developed a 
"proof".

     So please let me know if you want to apply HeapGuard or if you 
would like to work on verifying the proof.  


Sam Harbaugh
Integrated Software, Inc.
1945 Palm Bay Rd #7
Palm Bay, FL 32905   (407) 984-1986  fax (407) 951-4291
---------

geb@amber.Rational.COM (Gary Barnes) (01/10/91)

In article <EACHUS.91Jan4133652@aries.linus.mitre.org> eachus@linus.mitre.org (Robert I. Eachus) writes:
>     The second reason is that there are Ada compilers for several
>systems where garbage collection is normally a function of the
>operating system: Symbolics, Rational, Intel 432 (High Integrity
                              ^^^^^^^^

In the sense used by this thread, Rational does not provide garbage
collection.  The "garbage collection" provided by an R1000 is the same
as that provided by Unix or VMS.  When a program/process/job stops
running then the space in the "swap area" is reclaimed.  Internal to a
single program execution, this does not qualify as garbage collection.

Gary		geb@Rational.com