Storage allocation strategies

STORAGE ALLOCATION STRATEGIES

  1. Static Allocation: It is for all the data objects at compile time.
  2. Stack Allocation: In this a stack is used to manage the run time storage. For example recursive calls make use of this area. 
  3. Heap Allocation: In this a heap is used to manage the dynamic memory allocation.

Static Allocation

  • The size of data objects is known at compile time. 
  • The names of these objects are bound to storage at compile time only and such an allocation of data objects is done by static allocation.
  • The binding of name with the amount of storage allocated do not change at run time. Hence the name of this allocation is static allocation. 
  • In this the compiler can determine the amount of storage required by each data object and therefore it becomes easy for a compiler to find the address of these data in the activation record. 
  • At compiler time compiler can fill the address at which the target code can find the data it operates on. 
  • FORTRAN uses the static allocation.

Limitation of static allocation

  • The static allocation can be done only if the size of data object is known at compile time.\
  • The data structures cannot be created dynamically. In the sense that, the static allocation cannot manage the allocation of memory at run time. 
  • Recursive procedures are not supported by this type of allocation.

Stack Allocation

  • In this the storage is organized as stack .This stack is also called control stack.
  • As activation begins the activation records are pushed onto the stack and on completion of this activation the corresponding activation records can be popped. 
  • The locals are stored in the each activation record. Hence locals are bound to corresponding activation record on each fresh activation. 
  • The data structures can be created dynamically for stack allocation.

Limitation of stack allocation

The memory addressing can be done using pointers an index registers. Hence this type of allocation is slower than static allocation.

Heap Allocation

  • If the values of non local variables must be retained even after the activation record then such a retaining is not possible by stack allocation. This limitation of stack allocation is because of its Last in First Out nature. For retaining of such local variables heap allocation strategy is used.
  • The heap allocation allocates the continuous block of memory when required for storage of activation records or other data object, this allocated memory can be deallocated when activation ends. This deallocated space can be further reused by heap manager. 
  • The efficient heap management can be done by 
  • Creating a linked list for the free blocks and when any memory is deallocated that block of memory is appended in the linked list. 
  • Allocate the most suitable block o memory from the linked list i.e. use best fit technique for allocation of block.
Compiler Design

EasyExamNotes.com covered following topics in Compiler Design.
Python Programming ↓ 👆
Java Programming ↓ 👆
JAVA EasyExamNotes.com covered following topics in these notes.
JAVA Programs
Principles of Programming Languages ↓ 👆
Principles of Programming Languages
EasyExamNotes.com covered following topics in these notes.

Practicals:
Previous years solved papers:
A list of Video lectures References:
  1. Sebesta,”Concept of programming Language”, Pearson Edu 
  2. Louden, “Programming Languages: Principles & Practices” , Cengage Learning 
  3. Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill. 
  4. E Horowitz, "Programming Languages", 2nd Edition, Addison Wesley

    Computer Organization and Architecture ↓ 👆

    Computer Organization and Architecture 

    EasyExamNotes.com covered following topics in these notes.

    1. Structure of desktop computers
    2. Logic gates
    3. Register organization
    4. Bus structure
    5. Addressing modes
    6. Register transfer language
    7. Direct mapping numericals
    8. Register in Assembly Language Programming
    9. Arrays in Assembly Language Programming

    References:

    1. William stalling ,“Computer Architecture and Organization” PHI
    2. Morris Mano , “Computer System Organization ”PHI

    Computer Network ↓ 👆
    Computer Network

    EasyExamNotes.com covered following topics in these notes.
    1. Data Link Layer
    2. Framing
    3. Byte count framing method
    4. Flag bytes with byte stuffing framing method
    5. Flag bits with bit stuffing framing method
    6. Physical layer coding violations framing method
    7. Error control in data link layer
    8. Stop and Wait scheme
    9. Sliding Window Protocol
    10. One bit sliding window protocol
    11. A protocol Using Go-Back-N
    12. Selective repeat protocol
    13. Application layer
    References:
    1. Andrew S. Tanenbaum, David J. Wetherall, “Computer Networks” Pearson Education.
    2. Douglas E Comer, “Internetworking with TCP/IP Principles, Protocols, And Architecture",Pearson Education
    3. KavehPahlavan, Prashant Krishnamurthy, “Networking Fundamentals”, Wiley Publication.
    4. Ying-Dar Lin, Ren-Hung Hwang, Fred Baker, “Computer Networks: An Open Source Approach”, McGraw Hill.