What is memory pool

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bull

    #1

    What is memory pool

    hi
    could any one explain with example the following in a better way to
    understand
    1. what is stack in memory, how the programs are stored in stack , what
    is the use of stack
    2. What is heap in memory, how the programs are stored in heap , what
    is the use of heap
    3. what is pool memory otherwise memory pool, what is the use of memory
    pool
    4. what is difference between stack and heap
    5. what is the difference b/w pool and stack
    6. what is the difference b/w pool and heap




    thanks in advance

  • Allan Bruce

    #2
    Re: What is memory pool


    "bull" <ramasubbu.xr.r amasubramanian@ ericsson.com> wrote in message
    news:d2ggv0$bqj $1@newstree.wis e.edt.ericsson. se...[color=blue]
    > hi
    > could any one explain with example the following in a better way to
    > understand
    > 1. what is stack in memory, how the programs are stored in stack , what is
    > the use of stack
    > 2. What is heap in memory, how the programs are stored in heap , what is
    > the use of heap
    > 3. what is pool memory otherwise memory pool, what is the use of memory
    > pool
    > 4. what is difference between stack and heap
    > 5. what is the difference b/w pool and stack
    > 6. what is the difference b/w pool and heap
    >
    >
    >
    >
    > thanks in advance
    >[/color]

    These concepts are all irrelevant as far as c programming is concerned.
    Allan


    Comment

    • CBFalconer

      #3
      Re: What is memory pool

      bull wrote:[color=blue]
      >
      > could any one explain with example the following in a better way
      > to understand
      > 1. what is stack in memory, how the programs are stored in stack ,
      > what is the use of stack
      > 2. What is heap in memory, how the programs are stored in heap ,
      > what is the use of heap
      > 3. what is pool memory otherwise memory pool, what is the use of
      > memory pool
      > 4. what is difference between stack and heap
      > 5. what is the difference b/w pool and stack
      > 6. what is the difference b/w pool and heap[/color]

      None of those things necessarily exist in C. We have automatic
      memory, which is allocated on function entry and deallocated on
      function exit, and static memory, which is allocated until program
      completion. A subset of static memory is controlled memory,
      assigned by malloc, realloc, and calloc, and released by free.
      Where and how these things are supplied has nothing to do with a C
      program.

      Some systems use a stack for automatic memory, but this is not the
      only possible method.

      --
      "If you want to post a followup via groups.google.c om, don't use
      the broken "Reply" link at the bottom of the article. Click on
      "show options" at the top of the article, then click on the
      "Reply" at the bottom of the article headers." - Keith Thompson

      Comment

      • Thomas Matthews

        #4
        Re: What is memory pool

        bull wrote:[color=blue]
        > hi
        > could any one explain with example the following in a better way to
        > understand[/color]
        These are general programming questions and best discussed in
        news:comp.progr amming. Followups set.
        [color=blue]
        > 1. what is stack in memory, how the programs are stored in stack , what
        > is the use of stack[/color]
        Stack memory is memory that is treated like a stack of dishes:
        first in, first out (FIFO).

        I don't know of any programs that are stored in stack memory, but
        that doesn't mean there aren't any.

        Many programs use stack memory for temporary variables and also to
        store return addresses. The stack data structure is convenient here
        because the temporary variables can be "popped" off, restoring the
        memory area to where it was before the temporary variables were
        created. Search the web for "data structure stack" for more
        information (or read a good text book on data structures).

        [color=blue]
        > 2. What is heap in memory, how the programs are stored in heap , what
        > is the use of heap[/color]
        Generally speaking, a heap of memory is an area of memory that the
        program uses for run-time allocation of data.

        Programs can be stored in the heap, but I don't know of any
        languages that store functions in a heap. Although one could
        consider the memory that the operating system uses as a heap
        and a program is loaded into this heap and executed. To
        store a program in the heap, just move the executable code
        into the heap.

        [color=blue]
        > 3. what is pool memory otherwise memory pool, what is the use of memory
        > pool[/color]
        A memory pool is a vague concept. Sometimes it is a synonym
        for a heap. Other times it is memory shared by more than
        one task. Another definition is an area reserved by the
        program for allocation; versus a heap used by the language
        or operating system.

        [color=blue]
        > 4. what is difference between stack and heap
        > 5. what is the difference b/w pool and stack
        > 6. what is the difference b/w pool and heap
        >
        >
        >
        >
        > thanks in advance
        >[/color]


        --
        Thomas Matthews

        C++ newsgroup welcome message:

        C++ Faq: http://www.parashift.com/c++-faq-lite
        C Faq: http://www.eskimo.com/~scs/c-faq/top.html
        alt.comp.lang.l earn.c-c++ faq:

        Other sites:
        http://www.josuttis.com -- C++ STL Library book
        http://www.sgi.com/tech/stl -- Standard Template Library

        Comment

        • Jonathan Bartlett

          #5
          Re: What is memory pool

          I covered heap and pool-managed memory in my article on Memory Management:



          Jon
          ----
          Learn to program using Linux assembly language

          Comment

          • Keith Thompson

            #6
            Re: What is memory pool

            CBFalconer <cbfalconer@yah oo.com> writes:
            [...][color=blue]
            > None of those things necessarily exist in C. We have automatic
            > memory, which is allocated on function entry and deallocated on
            > function exit, and static memory, which is allocated until program
            > completion. A subset of static memory is controlled memory,
            > assigned by malloc, realloc, and calloc, and released by free.
            > Where and how these things are supplied has nothing to do with a C
            > program.[/color]

            A terminology quibble: I don't think the term "static" applies to
            malloc()-allocated memory.

            --
            Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
            San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
            We must do something. This is something. Therefore, we must do this.

            Comment

            Working...