Memory allocation (4)

3,732 views

Published on

memory allocation,preemitive allocation,non-preemitive allocation,first fit,best fit,

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,732
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
154
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Memory allocation (4)

  1. 1.  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.
  2. 2.  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.
  3. 3.  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.
  4. 4.  In static memory allocation, size of the memory may be required for the calculation that must be define before loading and executing the program.
  5. 5.  Two methods are used for dynamic memory allocation:1-Nonpreemptive allocation2-preemptive allocation
  6. 6.  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.
  7. 7.  In this algorithm, searching is started either at the beginning of the memory or where the previous first fit search ended.
  8. 8.  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.
  9. 9.  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.
  10. 10.  Fixed memory Stack memory Heap memory
  11. 11.  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).
  12. 12.  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
  13. 13.  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

×