Steady State ?

Discussion in 'C Programming' started by Amogh, May 10, 2006.

  1. Amogh

    Amogh Guest

    Hi,

    What does this sentence mean ?

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

    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.

    Rgds.
     
    Amogh, May 10, 2006
    #1
    1. Advertising

  2. In article <11n8g.38$>,
    Amogh <> 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
     
    Walter Roberson, May 10, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lamb
    Replies:
    1
    Views:
    707
  2. Weng Tianxiang
    Replies:
    7
    Views:
    1,151
    Mike Treseler
    Nov 25, 2003
  3. shamanthakamani
    Replies:
    1
    Views:
    3,535
    Natty Gur
    Nov 20, 2003
  4. Not Liking Dot Net Today
    Replies:
    0
    Views:
    664
    Not Liking Dot Net Today
    Apr 21, 2004
  5. Vinay Joseph Mathew

    Losing Session State on a State Server

    Vinay Joseph Mathew, Aug 10, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    621
    =?Utf-8?B?c29ubnk=?=
    Sep 16, 2004
Loading...

Share This Page