Memory is the processes by which information is encoded, stored and retrieved. Encoding allow information that is from the outside world to reach our senses in the forms of chemical and physical stimuli.
An alloation is something that you set aside for use .for instance if you want to set aside a certain amount of hard drive space for an application,you can allocate how much in the settings.
The placement of blocks of information in a memory system is called memory allocation. To allocate memory it is necessary to keep in information of available memory in the system.If memory management system finds sufficient free memory,it allocates only as much memory as needed ,keeping the rest available to satisfy future request . If sufficient memory is not available, swapping of blocks is done.
In static memory allocation, size of the memory may be required for the calculation that must be define before loading and executing the program.
Two methods are used for dynamic memory allocation:1-Nonpreemptive allocation2-preemptive allocation
Consider M1 as a main memory and M2 as a secondry memory and a block K of n words is to be transferred from M2 to M1.for such memory allocation it is necessary to find or create an available reason of n or more words to accommodate K.This process is known as nonpreemptive allocation.
In this algorithm, searching is started either at the beginning of the memory or where the previous first fit search ended.
In this algorithm, all free memory blocks are searched and smallest free memory block which is large enough to accommodate desired block K is used to allocate K.
Nonpreemptive allocation can’t make efficient use of memory in all situation. Due scattered memory blocks larger free memory blocks may not be available. Much more efficient us of the available memory space is possible if the occupied space can be re allocated to make room for incoming blocks by a method called as compaction.
Executable code Global variables Constant structures that don’t fit inside a machine instruction. (constant arrays, strings, floating points, long integers etc.) Static variables. Subroutine local variable in non-recursive languages (e.g. early FORTRAN).
Stores information in such a manner that the item stored last is the first item retrieved. In digital computer, it is essentially a memory unit with an address register that can count only after an initial value is loaded into it. Two operations of a stack are 1. Insertion 2. Deletion
Structures whose size varies dynamically (e.g. variable length arrays or strings). Structures that are allocated dynamically (e.g. records in a linked list). Structures created by a function call that must survive after the call returns.Issues: Allocation and free space management Deallocation / garbage collection