chapter 10 storage management - simpson...

10
Chapter 10 Storage management Elements requiring storage Programmer and system controlled storage Static Storage Management Heap Storage Management

Upload: hamien

Post on 28-Aug-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Chapter 10 Storage management

• Elements requiring storage

• Programmer and system controlled storage

• Static Storage Management

• Heap Storage Management

Page 2: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

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

Page 3: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Elements requiring storage

• Temporaries in expression evaluation

• Temporaries in parameter transmission

• Input-Output buffers• Miscellaneous system data - tables

etc

Page 4: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

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

Page 5: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

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 PhasesInitial allocationRecoveryCompaction and reuse

Page 6: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Static Storage Management

Static allocation : allocation during translation that remains fixed throughout execution.

Does not allow recursive subprograms

Page 7: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Dynamic Allocation:Heap Storage Management

Memory used for dynamic allocation of data objects in somewhat unstructured manner is called heap storage.

OS

HEAP

STACK

Page 8: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Heap Storage ManagementTasks:

allocation, recovery,

dangling referencesgarbage collection

compaction, reuse

Fixed size elementsVariable size elements

Page 9: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Heap Compaction

used used used

used

used used

used

Page 10: Chapter 10 Storage management - Simpson Collegefaculty.simpson.edu/.../LN315_Pratt/PPT/Chapter10.ppt · PPT file · Web view2003-01-04 · Chapter 10 Storage management Elements

Heap Compaction

used used used

used

used usedused