Chapter 10 Storage management

Slides:



Advertisements
Similar presentations
Introduction to Memory Management. 2 General Structure of Run-Time Memory.
Advertisements

Chapter 6 Data Types
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.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Various languages….  Could affect performance  Could affect reliability  Could affect language choice.
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.
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison- Wesley. All rights reserved. 1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
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 9 Subprogram Control Consider program as a tree- –Each parent calls (transfers control to) child –Parent resumes when child completes –Copy rule.
VBA Modules, Functions, Variables, and Constants
1 Chapter 7: Runtime Environments. int * larger (int a, int b) { if (a > b) return &a; //wrong else return &b; //wrong } int * larger (int *a, int *b)
Lifetime “The lifetime of a variable is the time during which the variable is bound to a specific memory location.” [p. 219] “…the lifetime of a variable.
Runtime Environments Source language issues Storage organization
Chapter 10 Storage Management Implementation details beyond programmer’s control Storage/CPU time trade-off Binding times to storage.
Encapsulation by Subprograms and Type Definitions
Run-Time Storage Organization
C and Data Structures Baojian Hua
Chapter 9: Subprogram Control
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
Memory Layout C and Data Structures Baojian Hua
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
Storage Management Lecture 12: Dolores Zage.
Name Binding and Object Lifetimes Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Concepts Lecture.
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.
Runtime Environments Compiler Construction Chapter 7.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
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.
Runtime Environments. Support of Execution  Activation Tree  Control Stack  Scope  Binding of Names –Data object (values in storage) –Environment.
1 Records Record aggregate of data elements –Possibly heterogeneous –Elements/slots are identified by names –Elements in same fixed order in all records.
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.
Pointers in C++. 7a-2 Pointers "pointer" is a basic type like int or double value of a pointer variable contains the location, or address in memory, of.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 9.
COMP3190: Principle of Programming Languages
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.
CSE 425: Control Abstraction I Functions vs. Procedures It is useful to differentiate functions vs. procedures –Procedures have side effects but usually.
CSC 8505 Compiler Construction Runtime Environments.
Concepts of programming languages Chapter 5 Names, Bindings, and Scopes Lec. 12 Lecturer: Dr. Emad Nabil 1-1.
RUNTIME ENVIRONMENT AND VARIABLE BINDINGS How to manage local variables.
LECTURE 13 Names, Scopes, and Bindings: Memory Management Schemes.
CHAPTER 8. MEMORY MANAGEMENT SUNG-DONG KIM DEPT. OF COMPUTER ENGINEERING, HANSUNG UNIVERSITY.
Runtime Environments Chapter 7. Support of Execution  Activation Tree  Control Stack  Scope  Binding of Names –Data object (values in storage) –Environment.
1 Programming Languages (CS 550) List Processing, Dynamic Memory Allocation and Garbage Collection Jeremy R. Johnson.
Code Generation Instruction Selection Higher level instruction -> Low level instruction Register Allocation Which register to assign to hold which items?
Object Lifetime and Pointers
Data Types In Text: Chapter 6.
Chapter 8. Memory Management
Depth First Search—Backtracking
Storage.
Segmentation Lecture November 2018.
Overview of Memory Layout in C++
Memory Allocation CS 217.
Operating System Chapter 7. Memory Management
Languages and Compilers (SProg og Oversættere)
Programming Languages
Dynamic Memory.
Lecture 35 Syed Mansoor Sarwar
RUN-TIME STORAGE Chuen-Liang Chen Department of Computer Science
Run-time environments
Presentation transcript:

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