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.

Slides:



Advertisements
Similar presentations
Memory Management Chapter FourteenModern Programming Languages, 2nd ed.1.
Advertisements

Dynamic Memory Allocation in C.  What is Memory What is Memory  Memory Allocation in C Memory Allocation in C  Difference b\w static memory allocation.
Topic 10 Java Memory Management. 1-2 Memory Allocation in Java When a program is being executed, separate areas of memory are allocated for each class.
CSI 3120, Implementing subprograms, page 1 Implementing subprograms The environment in block-structured languages The structure of the activation stack.
PZ10B Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ10B - Garbage collection Programming Language Design.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Prof. Necula CS 164 Lecture 141 Run-time Environments Lecture 8.
5. Memory Management From: Chapter 5, Modern Compiler Design, by Dick Grunt et al.
Memory Management & Method Calls in Java Program Execution © Allan C. Milne v
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison- Wesley. All rights reserved. 1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
Parallel Processing & Distributed Systems Thoai Nam Chapter 2.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
Chapter 10 Storage management
CSE 2501 Review Declaring a variable allocates space for the type of datum it is to store int x; // allocates space for an int int *px; // allocates space.
CS 536 Spring Run-time organization Lecture 19.
ISBN Chapter 10 Implementing Subprograms.
Chapter 10 Storage Management Implementation details beyond programmer’s control Storage/CPU time trade-off Binding times to storage.
Run-Time Storage Organization
Chapter 9: Subprogram Control
1 Contents. 2 Run-Time Storage Organization 3 Static Allocation In many early languages, notably assembly and FORTRAN, all storage allocation is static.
Chapter 5 Chapter 5 Abstraction I: Encapsulation.
COP4020 Programming Languages
Chapter 7: Runtime Environment –Run time memory organization. We need to use memory to store: –code –static data (global variables) –dynamic data objects.
Storage Management Lecture 12: Dolores Zage.
1 Programming Languages Implementation of Data Structures Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Name Binding and Object Lifetimes Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Concepts Lecture.
Runtime Environments What is in the memory? Runtime Environment2 Outline Memory organization during program execution Static runtime environments.
CS3012: Formal Languages and Compilers The Runtime Environment After the analysis phases are complete, the compiler must generate executable code. The.
CS 403: Programming Languages Lecture 2 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
1 Binding Time and Storage Allocation (Section ) CSCI 431 Programming Languages Fall 2003 A modification of slides developed by Felix Hernandez-Campos.
1 Programming Languages Implementation of Control Structures Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Runtime Environments Compiler Construction Chapter 7.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
Compiler Construction
Chapter 5: Programming Languages and Constructs by Ravi Sethi Activation Records Dolores Zage.
Chapter 7 Runtime Environments. Relationships between names and data objects As execution proceeds, the same name can denote different data objects Procedures,
Storage Bindings Allocation is the process by which the memory cell or collection of memory cells is assigned to a variable. These cells are taken from.
Basic Semantics Associating meaning with language entities.
Semantics of Arrays and Pointers By: M. Reza Heydarian Introduction Pointers Arrays Semantics of Arrays Semantics of Pointers.
Chapter 8 Memory Use. Chapter 8 -- Memory Use2  In this chapter we will consider memory use during compilation and run time.  During compilation, the.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. C H A P T E R F I V E Memory Management.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 9.
COMP3190: Principle of Programming Languages
Parallel Processing & Distributed Systems Thoai Nam And Vu Le Hung.
RUN-Time Organization Compiler phase— Before writing a code generator, we must decide how to marshal the resources of the target machine (instructions,
Lecture by: Prof. Pooja Vaishnav.  Language Processor implementations are highly influenced by the kind of storage structure used for program variables.
Heap storage & Garbage collection Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001.
Parallel Processing & Distributed Systems Thoai Nam Chapter 2.
CSC 8505 Compiler Construction Runtime Environments.
RUNTIME ENVIRONMENT AND VARIABLE BINDINGS How to manage local variables.
- means "replacement of a block of stored instructions or data with another.“ - a method that allows programs to be larger than the computer's main memory.
LECTURE 13 Names, Scopes, and Bindings: Memory Management Schemes.
Subprograms - implementation. Calling a subprogram  transferring control to a subprogram: save conditions in calling program pass parameters allocate.
CHAPTER 8. MEMORY MANAGEMENT SUNG-DONG KIM DEPT. OF COMPUTER ENGINEERING, HANSUNG UNIVERSITY.
Code Generation Instruction Selection Higher level instruction -> Low level instruction Register Allocation Which register to assign to hold which items?
Memory Management Functions
Data Types In Text: Chapter 6.
Run-time support Jakub Yaghob
Java Memory Management
Chapter 8. Memory Management
Java Memory Management
ENERGY 211 / CME 211 Lecture 25 November 17, 2008.
Data Structures Interview / VIVA Questions and Answers
Dynamic Memory Allocation
Implementing Subprograms
Created By: Asst. Prof. Ashish Shah, J.M.Patel College, Goregoan West
Course Overview PART I: overview material PART II: inside a compiler
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Run-time environments
Presentation transcript:

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 Storage Management Major run-time elements requiring storage Major operations requiring storage to be allocated/freed Storage management phases Storage management techniques

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

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

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

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 Storage Management Techniques 1.Static storage management 2.Stack-based storage management 3.Heap storage management  fixed-size elements  variable-size elements

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

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 Heap Storage Management Heap: a block of storage within which data are allocated/freed in an arbitrary manner.

11 heap head initial free-space list heap head

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