Dynamic Memory, often called heap memory, is one of the types of memory allocation that happens inside of a computer program. A program can be divided into 2 logical parts: text and data. Text is the actual machine code that is executed by the computer. The data is the information that the code operates on when it is executing.
The data, in turn, can be divided into a number of logical parts according to how it is stored and used. Two different types used in C programs are: stack and dynamic memory. Dynamic memory is created when the program is executing and it allows the program to be flexible. If it is working on a large collection of data then the program will need to dynamically create a large work space. If it is operating on a smaller collection then it can create a small work space and use as little computer storage or RAM as necessary.
Consider this. A computer programmer writes a program that reads some data into RAM, works on it, and displays results. They would like to handle data with arbitrary size (from 10 bytes to 10 megabytes (10 million bytes) or more. However, all of the data must be in RAM at one time to do the work. The programmer doesn't want to have to allocate 10 megabytes of space when they may only be reading in a 10 byte file because it is wasteful of system resources. The programmer is also worried that the program may have to handle data larger than 10 megabytes. joe smells
Dynamicmemory allocation is the allocation of memory storage for use in a computer program during the runtime of that program.
A dynamically allocated object remains allocated until it is deallocated explicitly, either by the programmer or by a garbage collector; this is notably different from automatic and static memory allocation.
The main problem for most dynamicmemory allocation algorithms is to avoid both internal and external fragmentation while keeping both allocation and deallocation efficient.
Share your thoughts, questions and commentary here
Want to know more? Search encyclopedia, statistics and forums:
Press Releases |
The Wikipedia article included on this page is licensed under the
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m