Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 0 Lesson 7 Memory Management.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
5. Memory Management From: Chapter 5, Modern Compiler Design, by Dick Grunt et al.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
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.
Memory Design Example. Selecting Memory Chip Selecting SRAM Memory Chip.
Operating System Support Focus on Architecture
ISBN Chapter 5 Names, Bindings, Type Checking, and Scopes Names Variables The Concept of Binding Type Checking Strong Typing Type Compatibility.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Memory Management 2010.
Memory Organization.
Memory Allocation and Garbage Collection. Why Dynamic Memory? We cannot know memory requirements in advance when the program is written. We cannot know.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
MEMORY MANAGEMENT By KUNAL KADAKIA RISHIT SHAH. Memory Memory is a large array of words or bytes, each with its own address. It is a repository of quickly.
Computer Organization and Architecture
Virtual Memory:Part 2 Kashyap Sheth Kishore Putta Bijal Shah Kshama Desai.
Virtual Memory BY JEMINI ISLAM. What is Virtual Memory Virtual memory is a memory management system that gives a computer the appearance of having more.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Memory Management Ch.8.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
CS2303 C14 Systems Programming Concepts Bob Kinicki.
CS 350 Operating Systems & Programming Languages Group: Victor Yevtukh, Kyle Tassey, Ankit Tamakuala, Matt Wetzel, David Yeager, Michael Wang, Yuan Xu.
Microprocessor-based systems Curse 7 Memory hierarchies.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
1 Programming Language History and Evolution In Text: Chapter 2.
Processes and OS basics. RHS – SOC 2 OS Basics An Operating System (OS) is essentially an abstraction of a computer As a user or programmer, I do not.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Memory management (CTM 2.5) Carlos Varela RPI April 6, 2015.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
Memory Management COSC 513 Presentation Jun Tian 08/17/2000.
Memory Management. Memory  Commemoration or Remembrance.
A summary by Nick Rayner for PSU CS533, Spring 2006
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
Introduction to Virtual Memory and Memory Management
Memory Management. Why memory management? n Processes need to be loaded in memory to execute n Multiprogramming n The task of subdividing the user area.
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Memory Management Chapter 5 Advanced Operating System.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
Computer Architecture Chapter (8): Operating System Support
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Programming Language History and Evolution
Storage Allocation Mechanisms
Virtual memory.
Non Contiguous Memory Allocation
Chapter 2 Memory and process management
Machine and Assembly Language
Why study programming languages?
Chapter 9 – Real Memory Organization and Management
William Stallings Computer Organization and Architecture
Programming Language History and Evolution
Chapter 2: System Structures
Principles of Programming Languages
Overview of Programming Paradigms
Operating System Introduction.
Programming Languages and Paradigms
COMP755 Advanced Operating Systems
Memory Management Memory management is the art and the process of coordinating and controlling the use of memory in a computer system Why memory management?
Presentation transcript:

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 0 Lesson 7 Memory Management

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 1 LESSON OVERVIEW  areas of memory management  Memory and storage management  Memory management in virtual systems  Address translation mechanisms  Memory management problems  Manual memory management  Automatic memory management

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 2 Areas Of Memory Management Memory management is usually divided into three areas:  Hardware  Operating system  Application

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 3 Hardware Memory Management Memory management at the hardware level is concerned with the electronic devices that actually store data. This includes things like RAM and memory caches.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 4 Operating System Memory Management In the operating system, memory must be allocated to user programs, and reused by other programs when it is no longer required. The operating system can pretend that the computer has more memory than it actually does, and also that each program has the machine's memory to itself.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 5 Application Memory Management_1 It involves supplying the memory needed for a program's objects and data structures from the limited resources available, and recycling that memory for reuse when it is no longer required. Because application programs cannot in general predict in advance how much memory they are going to require, they need additional code to handle their changing memory requirements.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 6 Application Memory Management_2 Application memory management combines two related tasks:  Allocation  Recycling

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 7 Application Memory Manager  CPU overhead  Interactive pause times  Memory overhead

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 8 Memory In Computer System  Virtual memory  High-speed cache  Main memory  Secondary memory

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 9 Memory Management In Virtual System  Demand Paging  Fetching  Perfecting  Replacement Strategies

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Memory Manager  Provides abstraction of a protected address space through translation.  Provides the abstraction of large virtual address spaces, effectively liberating programmers from physical memory constraints.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Address Translation Mechanisms_1  Efficiency in sparse address space  Address translation for protection  Generic address translation  Obvious solution

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Address Translation Mechanisms_2  Paging  Protection  Problems  Advantages  Obvious solution

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Memory Management Problems  Typical Problem  Parameter free or dangling pointer  Memory leak  External fragmentation  Poor locality of reference  Inflexible design  Interface complexity

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Advantages Of Memory Management  It can be easier for the programmer to understand exactly what is going on;  Some manual memory managers perform better when there is a shortage of memory.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Disadvantages Of Memory Management  The programmer must write a lot of code to do repetitive bookkeeping of memory;  Memory management must form a significant part of any module interface;  Manual memory management typically requires more memory overhead per object;  Memory management bugs are common.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Manual Memory Management In Most Implementations  Algol  C  C++ The following languages use mainly manual memory management in most implementations, although many have conservative garbage collection extensions:  COBOL  Fortran  Pascal.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Advantages Of Automatic Memory Management  The programmer is freed to work on the actual problem  Module interfaces are cleaner  There are fewer memory management bugs  Memory management is often more efficient

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Disadvantages Of Automatic Memory Management  Memory may be retained because it is reachable, but won't be used again;  Automatic memory managers (currently) have limited availability.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA Most Modern Languages Used Mainly In Automatic Memory Management  BASIC  Dylan TM  Erlang  Haskell  Java TM  JavaScript TM  Lisp  ML  Modula-3  Perl  thePostScript ® language  Prolog  Python  Scheme  Smalltalk