[net.lang.ada] Storage fragmentation in Ada

sdl@MITRE-BEDFORD.ARPA (Litvintchouk) (08/02/86)

In using dynamically allocated objects in Ada, a major problem can be
fragmentation of available storage.  Storage fragmentation of the
heap(s), can occur when different sized objects are deallocated in an
order different from the order they were originally allocated.  This
is serious in embedded computer systems that run for fairly long
periods of time.  Eventually storage will become so fragmented that
attempting to do further allocation will raise STORAGE_ERROR.


UNCHECKED_DEALLOCATION is only a partial solution to fragmentation,
because:

  a) it only indicates that the storage "is no longer required" (LRM
	13.10.1); it doesn't force deallocation to occur at any
	particular time

  b) If objects are allocated from multiple Ada units, a global policy
	of heap management may need to be imposed on the entire
	Ada program (difficult if multiple tasks do their own 
	storage allocation)


If anyone out there knows of Ada compilers whose runtime management
provides for storage compaction, paging, or other scheme for dealing
with storage fragmentation, please let me know.  Also, if there are
Ada design methodologies that allow use of dynamic storage allocation
w/o fragmentation, I would like to know that too.  I will post any
replies I receive to the net.  Thanx very much in advance!


BTW, Thanx very much to all who responded to my earlier query for
tasking optimization techniques.  I will post a summary in a couple of
days.


Steven Litvintchouk
MITRE Corporation
Burlington Road
Bedford, MA  01730
(617)271-7753

ARPA:  sdl@mitre-bedford
UUCP:  ...{decvax,genrad,philabs,security,utzoo}!linus!sdl