Memory Management From Chapter 4, Modern Operating Systems, Andrew S. Tanenbaum.

Slides:



Advertisements
Similar presentations
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Advertisements

Chapter 4 Memory Management Basic memory management Swapping
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Chapter 3 Memory Management
Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Memory Management.
Basic Memory Management Monoprogramming Protection Swapping Overlaying OS space User space.
Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Memory management Lecture 7 ~ Winter, 2007 ~.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Memory Management Paging &Segmentation CS311, CS350 & CS550.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
9.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Memory OSC: Chapter 9. Demand Paging Copy-on-Write Page Replacement.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement.
1 Memory Management Managing memory hierarchies. 2 Memory Management Ideally programmers want memory that is –large –fast –non volatile –transparent Memory.
Memory Management Design & Implementation Segmentation Chapter 4.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
1 CSE 380 Computer Operating Systems Instructor: Insup Lee University of Pennsylvania, Fall 2002 Lecture Note: Memory Management.
Memory Management Chapter 4. Memory hierarchy Programmers want a lot of fast, non- volatile memory But, here is what we have:
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
1 Pertemuan 16 Isu-Isu pada Sistem Paging dan Segmentasi Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Paging Design.
Memory Management 2010.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Chapter 3.2 : Virtual Memory
1 Pertemuan 11 Manajemen Memori Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS02.
Chapter 3 Memory Management
Computer Organization and Architecture
Virtual Memory Management B.Ramamurthy. Paging (2) The relation between virtual addresses and physical memory addres- ses given by page table.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
Avishai Wool lecture Introduction to Systems Programming Lecture 6 Memory Management.
Memory Management 2 Tanenbaum Ch. 3 Silberschatz Ch. 8,9.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
CS 241 Section Week #12 (04/22/10).
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
CS450/550 Operating Systems Lecture 4 memory
Memory Management Page replacement algorithms, segmentation Tanenbaum, ch. 3 p Silberschatz, ch. 8, 9 p
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved OPERATING SYSTEMS DESIGN.
Operating Systems Chapter 8
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
1 Memory Management Chapter Basic memory management 4.2 Swapping (εναλλαγή) 4.3 Virtual memory (εικονική/ιδεατή μνήμη) 4.4 Page replacement algorithms.
1 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 4 Memory Management Virtual Memory.
“ Memory Management Function ” Presented By Lect. Rimple Bala GPC,Amritsar 1.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
1 Memory Management Review of Designs and Issues Basic memory management Swapping Virtual memory Page replacement algorithms Design issues for paging systems.
Demand Paging Reference Reference on UNIX memory management
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
操作系统原理 OPERATING SYSTEM Chapter 3 Memory Management 内存管理.
1 Memory Management Chapter Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement.
1 Memory Management Adapted From Modern Operating Systems, Andrew S. Tanenbaum.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Virtual Memory What if program is bigger than available memory?
Memory Management Chapter 3
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 8: Main Memory.
Session 3 Memory Management
Chapter 8: Main Memory.
Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping
Page Replacement.
Virtual Memory فصل هشتم.
Chapter 4: Memory Management
Computer Architecture
COMP755 Advanced Operating Systems
Virtual Memory.
Presentation transcript:

Memory Management From Chapter 4, Modern Operating Systems, Andrew S. Tanenbaum

Memory Management Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory – cache some medium-speed, medium price main memory gigabytes of slow, cheap disk storage Memory managers handle the memory hierarchy

Basic Memory Management Monoprogramming without Swapping or Paging Three simple ways of organizing memory - an operating system with one user process

Multiprogramming with Fixed Partitions Fixed memory partitions separate input queues for each partition single input queue

Relocation and Protection Cannot be sure where program will be loaded in memory address locations of variables, code routines cannot be absolute must keep a program out of other processes’ partitions Use base and limit values address locations added to base value to map to physical addr address locations larger than limit value is an error Self-relocation Program computes its own references

Swapping (1) Memory allocation changes as processes come into memory leave memory Shaded regions are unused memory (global fragmentation)

Swapping (2) Allocating space for growing data segment Allocating space for growing stack & data segment

Virtual Memory Paging (1) The position and function of the MMU

Paging (2) The relation between virtual addresses and physical memory addresses given by page table Frame#

Page Tables (1) Internal operation of MMU with 16 4 KB pages

Page Tables (2) 32 bit address with 2 page table fields Second-level page tables 32 bit address with 2 page table fields Two-level page tables Top-level page table

Typical page table entry Page Tables (3) Typical page table entry

TLBs – Translation Lookaside Buffers A TLB to speed up paging

Inverted Page Tables Comparison of a traditional page table with an inverted page table

Page Replacement Algorithms (1) Page fault forces choice which page must be removed make room for incoming page Modified page must first be saved unmodified just overwritten Better not to choose an often used page will probably need to be brought back in soon

Page Replacement Algorithms (2) Least Recently Used (LRU) Not Frequently Used (NFU) Aging Working Set WSClock Optimal Page Replacement Replace page needed at the farthest point in future Optimal but unrealizable Not Recently Used (NRU) FIFO Second Chance Clock

Design Issues for Paging Systems Local versus Global Allocation Policies Original configuration Local page replacement Global page replacement

Cleaning Policy (Garbage Collection) Need for a background process, paging daemon periodically inspects state of memory When too few page frames are free selects pages to evict using a replacement algorithm

Load Control Despite good designs, system may still thrash when some processes need more memory but no processes need less Solution : Reduce number of processes competing for memory swap one or more to disk, divide up pages they held reconsider degree of multiprogramming

Page Size Small page size Advantages Disadvantages less internal fragmentation better fit for various data structures, code sections Disadvantages program needs more pages has larger page table

Separate Instruction and Data Spaces One address space Separate I and D spaces

Two processes sharing same program sharing its page table Shared Pages Two processes sharing same program sharing its page table

References Chapters 8 and 9 :OS Concepts, Silberschatz, Galvin, Gagne Chapter 4: Modern Operating Systems, Andrew S. Tanenbaum X86 architecture http://en.wikipedia.org/wiki/Memory_segment Memory segment http://en.wikipedia.org/wiki/X86 Memory model http://en.wikipedia.org/wiki/Memory_model IA-32 Intel Architecture Software Developer’s Manual, Volume 1: Basic Architecture http://www.intel.com/design/pentium4/manuals/index_new.htm