comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.Leake@gsfc.nasa.gov>
Subject: Re: Please Help.
Date: 1997/09/19
Date: 1997-09-19T00:00:00+00:00	[thread overview]
Message-ID: <3422BE2E.62B1@gsfc.nasa.gov> (raw)
In-Reply-To: dewar.874604078@merv


Robert Dewar wrote:
> 
> <<The downside is heap fragmentation, which will bite you just when it
>   costs the most to fix. Controlled types can guarantee no dangling
>   pointers; they do not guarantee no heap fragmentation. For that you need
>   compacting storage pools (or very careful use of Unbounded_Strings).
> 
>   Is there a requirement in Ada 95 to document whether the
>   Unbounded_Strings implementation is compacting? This would be useful
>   information; I haven't seen it in Annex M for ObjectAda, but I don't
>   believe I've read the whole thing.>>
> 
> Well these days on typical machines, fragmentation just translates into
> poorer performance because of more paging. But compacting may or may not
> help to reduce paging. It is not a clear call at all

Ok, for typical users on hosts with virtual memory. I have seen systems
that run under Windows 95 where paging due to non-compacting reduced
performance to the point where it was unacceptable. If I do get to a
situation like this, I would like to be able to determine whether the
run-time library is compacting or not.

In the context of an embedded system with (no virtual memory) that has
to run forever? Then compacting (or not using dynamic strings) becomes a
requirement.
 
> There is no requirement for documenting this, since there is no imagination
> of compacting being an issue. (there is also no requirement to document
> whether your storage allocator reads the CMOS clock, or takes locks, or
> makes direct BIOS calls, or allocates more than it needs to, or anything
> else!)

I can measure the time it takes to execute my code (that seems to be the
primary effect of the other things you list). Measuring how much memory
is allocated can be done (to  first approximation) by simpler pointer
subtraction.  But I cannot measure heap fragmentation, at least not
without support from the compiler/run-time vendor (a heap display tool).
Thus it should be in the documentation, at least for the Real-Time
Systems Annex.

If I have a reasonable relationship with the compiler vendor, I should
be able to get any information I need, without it being part of the Ada
standard. But I feel strongly that this issue (compacting dynamic
memory) is ignored by too many programmers, so I'd like to raise its
visibility.

-- 
- Stephe




  reply	other threads:[~1997-09-19  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  0:00 Please Help Ken
1997-09-09  0:00 ` Stephen Leake
1997-09-09  0:00 ` Dale Stanbrough
1997-09-11  0:00   ` Robert Dewar
1997-09-12  0:00     ` Tristan Ludowyk
1997-09-12  0:00       ` Robert Dewar
1997-09-13  0:00         ` Matthew Heaney
1997-09-13  0:00           ` Dale Stanbrough
1997-09-12  0:00       ` Dale Stanbrough
1997-09-12  0:00         ` Stephen Leake
1997-09-13  0:00           ` Robert Dewar
1997-09-15  0:00             ` Stephen Leake
1997-09-15  0:00               ` Dale Stanbrough
1997-09-16  0:00               ` Robert Dewar
1997-09-17  0:00                 ` Stephen Leake
1997-09-18  0:00                   ` Robert Dewar
1997-09-19  0:00                     ` Stephen Leake [this message]
1997-09-19  0:00                       ` Robert S. White
1997-09-20  0:00                       ` Robert Dewar
1997-09-15  0:00     ` Richard A. O'Keefe
1997-09-16  0:00       ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2001-10-25  6:55 please help Phosphorus
2001-10-25  8:22 ` Preben Randhol
2001-10-25 12:35 ` Marc A. Criley
replies disabled

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