Jump to content

Talk:Dynamic memory allocation

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 72.12.209.138 (talk) at 15:34, 2 September 2009 (Clarity: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconComputing Redirect‑class
WikiProject iconThis redirect is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
RedirectThis redirect does not require a rating on Wikipedia's content assessment scale.

Two meanings of heaps

Can someone please expand the section "Heap-based memory allocation"? How exactly is the Heap data structure utilized in it? thx!

It isn't! Just a coincidence in naming. Good point. Usually the heap is based on one of the discussed allocation algorithms such as free lists or the buddy system. Deco 01:53, 29 December 2005 (UTC)[reply]
Do we know of the history of why it got to be called 'heap' instead of an infinite number of other things and who was the person or company who used the term heap first?
I'm guessing now, but the terms could be related: A simple implementation of the (memory allocation) heap is to represent the set of free blocks using a (max-)heap data structure, where the keys are block sizes. Allocation is greedy: Take the largest free block (top of the heap), allocate a sufficient portion of it, and perform decrease-key on the top of the heap. To deallocate memory, just add it to the heap. With this method, allocation and deallocation is simple and fast, but it probably gives huge problems with memory fragmentation. --Erik 16:18, 10 February 2006 (UTC)[reply]
That is an interesting point. But yes, consistently allocating from the largest block seems doomed to cause rapid fragmentation. However, although I don't have a source on this, historically I believe the terms both originated from the English concept of a heap of stuff, rather than having any relation to one another. Deco 18:40, 10 February 2006 (UTC)[reply]

please give me about heap memory allocation and deallocation explanation with example use of garbage collection.

Algorithms

My comment: This needs more description of specific designs and algorithms, for example, best-fit vs first-fit, free-lists vs rovers, linked-lists vs trees vs cells for space management, ...

Clearly there is a lot more that needs mention here than what is present. Cr88192 22:10, 12 May 2007 (UTC)[reply]

Inconsistency

  • From this article:

Buddy block allocators are used both in real-time operating systems and in general-purpose operating systems (such as Microsoft Windows and Linux).

Compared to the memory allocation techniques (such as paging) that modern operating systems such as Microsoft Windows and Linux use, the buddy memory allocation is relatively easy to implement, and does not have the hardware requirement of a memory management unit (MMU).

Both are true. Large-scale modern OSs have multiple allocators, at the least one for the kernel and one for every process. Each uses its own system of allocation. The wording could be corrected to clarify this (e.g., "are one type of allocator used in"). Dcoetzee 22:45, 25 February 2008 (UTC)[reply]
  • Automatic allocation, especially of arrays with run-time bounds, is a subset of dynamic allocation. The introductory paragraphs have been modified to take that into consideration. The page on automatic allocation is no help at all. Gah4 (talk) 23:52, 10 June 2008 (UTC)[reply]

Clarity

The section headed "Details" is very terse, uses sentence fragments, and is not very clear. It should be cleaned up a bit.