TheBestLinks.com
TheBestLinks.com
Dynamic memory allocation, Computer storage, Computer program, C programming ... Print friendly version | Tell a friend
 
Navigation
Search
Toolbox

Dynamic memory allocation

From TheBestLinks.com

de:Heap (Speicher) Dynamic memory allocation is the allocation of memory storage for use in a computer program during the runtime of that program. Memory is typically allocated from a large pool of all available unused memory called the heap, but may also be allocated from multiple pools. A dynamically allocated object remains allocated until it is deallocated explicitly, either by the programmer or by an garbage collector; this is notably different from automatic and static memory allocation. We say that such an object has dynamic lifetime.

The problem of fulfilling an allocation request, which involves finding a block of unused memory of a certain size in the heap, is a difficult problem, and a huge variety of solutions have been proposed, including:

The main problem for most dynamic memory allocation algorithms is to avoid both internal or external fragmentation while keeping both allocation and deallocation efficient. Also, most algorithms in use have the problem that a large number of small allocations can cause wasted space due to collecting metadata; thus most programmers avoid this.

Language support

Dynamic allocation of some kind is directly supported in almost all programming languages. The malloc function is used to dynamically allocate memory in C. The new operator is used to dynamically allocate memory in C++ and Java.

Related links


Top visited 0 of 0 links

[no links posted yet]

>> place link >>

Discussion

Last posted 0 of 0 messages

[no messages posted yet]

>> post message >>

Watch

You can add this article to your own "watchlist" and receive e-mail notification about all changes in this page.
 
   
Innovate it
This page was last modified 16:17, 26 Sep 2004.
  Content is available under GNU Free Documentation License 1.2.
Powered by MediaWiki