120 likes | 408 Views
Chapter 10 Storage management. Elements requiring storage Programmer and system controlled storage Static Storage Management Heap Storage Management. Elements requiring storage. Code segments for translated user programs System run-time programs - e.g. libraries
E N D
Chapter 10 Storage management • Elements requiring storage • Programmer and system controlled storage • Static Storage Management • Heap Storage Management
Elements requiring storage • Code segments for translated user programs • System run-time programs - e.g. libraries • User defined data structures and constants • Subprogram return points • Referencing environments
Elements requiring storage • Temporaries in expression evaluation • Temporaries in parameter transmission • Input-Output buffers • Miscellaneous system data - tables etc
Operations that require storage allocation • Subprogram call and return operations - creation and deletion of activation records • Explicit data structure creation and destruction operations • Component insertion and deletion operations
Programmer and system controlled storage • Pros and cons: • Programmer knows when to allocate / free storage. • Programmer may interfere with the system-controlled storage management • Storage-Management Phases • Initial allocation • Recovery • Compaction and reuse
Static Storage Management • Static allocation : • allocation during translation that remains fixed throughout execution. • Does not allow recursive subprograms
Dynamic Allocation:Heap Storage Management Memory used for dynamic allocation of data objects in somewhat unstructured manner is called heap storage. OS HEAP STACK
Heap Storage Management • Tasks: • allocation, • recovery, • dangling references • garbage collection • compaction, • reuse • Fixed size elements • Variable size elements
Heap Compaction used used used used used used used
Heap Compaction used used used used used used used