Re: Steady State ?



In article <11n8g.38$rj1.99@xxxxxxxxxxxxxxx>,
Amogh <amogh.r@xxxxxxxxxx> wrote:

What does this sentence mean ?

"A nonfragmenting memory allocator reaches steady state as soon
as it exercises all the parts of the application"

It helps when you provide the context for the quote. I found it at
http://www.ednasia.com/print.asp?id=182
which places special emphasis on memory allocation issues
for embedded systems.

Is steady state a state where the memory allocation routine is not
called upon to allocate more memory by the application ?
For example if I call malloc five times in my program, is the memory
allocator in a steady state after the last call to malloc? I could be
wrong. Please clarify.

In the context of the article, non-fragmenting memory allocation
regimes are not permitted to request dynamic memory allocation such as
via calls to malloc(). When it is known that there is no dynamic memory
allocation, then there is no heap, and all variables can be either
statically allocated or allocated on the stack at runtime, with the
stack memory being completely deallocated when the function returns. In
such a situation, there is no memory fragmentation, and if there is no
recursion then there is a sequence of calls that results in a maximal
memory allocation that will not be exceeded by any other call pattern.
The memory allocator at that point will have reached a "steady state"
in the sense that no -worse- memory usage will occur.

If recusion is added to the mix, then one still might be able to
get to the steady-state point, if one can prove upper bounds on
the recusion depth.


If dynamic memory allocation is added in, then a worst-case
analysis requires knowledge of the details of the memory allocation
strategy, together with firm upper bounds on variables, and firm
algorithm restrictions such that dynamically allocated memory
is always deallocated by the end of the routine that allocated it
[and that no persistant variable may be assigned a pointer into
dynamically allocated memory, so nothing keeps a handle onto
memory that is officially deallocated.] These are fairly strong
restrictions on the algorithms that seldom apply to programs
that are not specifically written for embedded (or "provably secure")
systems. Therefore if dynamic memory allocation is allowed,
then for -most- programs, one must Test! Test! Test! to be sure
that memory exhaustion through fragmentation will not occur.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
.



Relevant Pages

  • Re: allocating memory.
    ... So what would be the ASM equivalent of new memory ... Memory allocation is primarily an OS responsibility, ... OSes are almost certainly responsible for memory ...
    (alt.lang.asm)
  • Re: Doubts on Defining and declaring variables
    ... 1.Dim iage ... and allocate memory for each of them ... My understanding:-Still No memory allocation done at this ... Now since string is assigned to iage,So will ...
    (microsoft.public.scripting.vbscript)
  • Re: xmalloc string functions
    ... require memory allocations depending on the way the system works. ... Not enough context for most real-world applications to ... It is /more/ reliable to routinely auto-save the user's work (as you ... particularly if your auto-save code is robust against memory allocation ...
    (comp.lang.c)
  • Re: "Criticism of the C programming language ??????"
    ... whatever) is that GC only affects memory allocated by GC_malloc. ... other applications and third party libraries will use it too? ... I didn't see how that could be true since, like KT, I was thinking of garbage collection integrated into the language itself. ... In a later message, after a burst of silly and pointless sarcasm, you were persuaded to explain that you were talking about an additional memory allocation library which would support garbage collection for memory it controlled. ...
    (comp.lang.c)
  • Re: Why does dynamic memory allocation take so long?
    ... > I was wondering why dynamic memory allocation took so long? ... > and a memory pointer, and every time I generated a new prime ... > I left out that I am programming in Pascal using GPC. ...
    (Debian-User)