473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

Nov 14 '05 #1
5 6991

"bull" <ra**************************@ericsson.com> wrote in message
news:d2**********@newstree.wise.edt.ericsson.se...
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


These concepts are all irrelevant as far as c programming is concerned.
Allan
Nov 14 '05 #2
bull wrote:

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


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.com, 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

Nov 14 '05 #3
bull wrote:
hi
could any one explain with example the following in a better way to
understand These are general programming questions and best discussed in
news:comp.programming. Followups set.
1. what is stack in memory, how the programs are stored in stack , what
is the use of stack 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).

2. What is heap in memory, how the programs are stored in heap , what
is the use of heap 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.

3. what is pool memory otherwise memory pool, what is the use of memory
pool 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.

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

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
Nov 14 '05 #4
I covered heap and pool-managed memory in my article on Memory Management:

http://www.ibm.com/developerworks/li...rary/l-memory/

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
Nov 14 '05 #5
CBFalconer <cb********@yahoo.com> writes:
[...]
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.


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

--
Keith Thompson (The_Other_Keith) ks***@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.
Nov 14 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Philip Lawatsch | last post by:
Hi, I have some questions about whats written in http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.14 (Describing some memory pool) #1 From what i understand this will also work for new...
2
by: Abhi | last post by:
Hi, I am looking for some memory pool implementation of new/delete. Is there any freeware/shareware/software out there? Any pointers would be great help. Thanks ......Abhi
4
by: MSUTech | last post by:
Hello All, I am getting an ASP error.. that tells the server it is OUT OF MEMORY.. then the server displays a message about the DLLHOST.exe and it waits for an "OK" from me... after hitting...
8
by: Tron Thomas | last post by:
As part of applying for a programming position at a company, I recently I had submitted some code samples to one of the developers for review. This is the feedback I received: One of his...
11
by: Grey Alien | last post by:
Any one know of an open source memory pool library?. I can't seem to find any implemented in C (many available in C++ e.g. Boost). Google is not turning up anything useful ...
11
by: Grey Alien | last post by:
I am looking to write a very simple memory pool library to store only one data type at a time - i.e. to provide a contiguous block of memory to be alloc'd free'd by the calling program. I am I...
16
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.