Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

There are three typical ways to allocate memory for programs: static, stack and dynamic heap. However, when I look at the implementation of dynamic heap memory allocation from wikipedia , what I found is fixed block allocation, etc. So why is dynamic memory allocation called "heap" memory allocation? How does it have something to do with "heap"?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Heap memory and the heap data structure are two different and unrelated things. This really bothered me when I was learning about memory, especially since stack memory was actually a stack. The original use of the word heap in computer science referred to the data structure. However, in the 1970s some authors began to use the word heap to refer to the pool of available memory. This use actually more closely matches the English definition of heap - an untidy collection of things - since heap memory is a messy place to allocate and deallocate memory. The name stuck and now we have multiple meanings for the word heap.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.