|
Dynamic memory - Definition and Overview |
| Related Words: Active, Acute, Aggressive, Alive, Animated, Brisk, Cogent, Driving, Electric, Energetic, Enthusiastic |
|
|
|
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
|
|
|