Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Programming Languages Storage Management Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.

Similar presentations


Presentation on theme: "1 Programming Languages Storage Management Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM."— Presentation transcript:

1 1 Programming Languages Storage Management Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM

2 2 Storage Management Major run-time elements requiring storage Major operations requiring storage to be allocated/freed Storage management phases Storage management techniques

3 3 Run-time elements Code segments System run-time programs  library routines  storage management routines User-defined data structures Subprogram return points

4 4 Run-time elements Referencing environments Temporaries in expression evaluation Temporaries in parameter transmission Input-output buffers Miscellaneous system data

5 5 Run-time operations Subprogram call and return operations Data structure creation and destruction operations Component insertion and deletion operations

6 6 Storage Management Phases 1.Initial allocation: allocating free storage 2.Recovery: recovering unused storage  garbage collection 3.Compaction and reuse:  compaction: to construct large blocks  reuse: as initial allocation

7 7 Storage Management Techniques 1.Static storage management 2.Stack-based storage management 3.Heap storage management  fixed-size elements  variable-size elements

8 8 Static Storage Management Static allocation: allocation that remains fixed through out execution.

9 9 Stack-based Storage Management First Allocated - Last Freed. Simple storage recovery, compaction and reuse. Not applicable if storage needs to be allocated/freed at arbitrary points.

10 10 Heap Storage Management Heap: a block of storage within which data are allocated/freed in an arbitrary manner.

11 11 heap head initial free-space list heap head

12 12 heap (storage allocated by NEW) typical Pascal memory organization subprogram code segments and system run-time routines (statically allocated) stack bottom activation records free space heap bottom


Download ppt "1 Programming Languages Storage Management Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM."

Similar presentations


Ads by Google