Memory management.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Part IV: Memory Management
Memory management In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. Memory management is achieved.
Chapter 2: Memory Management, Early Systems
Chapter 2: Memory Management, Early Systems
Memory Management, Early Systems
Understanding Operating Systems Fifth Edition
Memory Management Chapter 7.
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2009, Prentice.
CS 311 – Lecture 21 Outline Memory management in UNIX
OS Fall’02 Memory Management Operating Systems Fall 2002.
CS 104 Introduction to Computer Science and Graphics Problems
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management Chapter 5.
Silberschatz, Galvin and Gagne  Operating System Concepts Multistep Processing of a User Program User programs go through several steps before.
03/05/2008CSCI 315 Operating Systems Design1 Memory Management Notice: The slides for this lecture have been largely based on those accompanying the textbook.
1 Lecture 8: Memory Mangement Operating System I Spring 2008.
Memory management. Instruction execution cycle Fetch instruction from main memory Decode instruction Fetch operands (if needed0 Execute instruction Store.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Swapping and Contiguous Memory Allocation. Multistep Processing of a User Program User programs go through several steps before being run. Program components.
Memory Management Chapter 7.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Chapter 7 Memory Management
© 2004, D. J. Foreman 1 Memory Management. © 2004, D. J. Foreman 2 Building a Module -1  Compiler ■ generates references for function addresses may be.
Chapter 4 Memory Management.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Memory Management. Roadmap Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management –Paging –Segmentation.
Chapter 10 Memory Management Introduction Process must be loaded into memory before being executed. Input queue – collection of processes on the.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
Memory Management. Introduction To improve both the utilization of the CPU and the speed of its response to users, the computer must keep several processes.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Main Memory. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
CHAPTER 3-1, 3-2 MEMORY MANAGEMENT. MEMORY HIERARCHY Small amount of expensive, fast, volatile cache Larger amount of still fast, but slower, volatile.
2010INT Operating Systems, School of Information Technology, Griffith University – Gold Coast Copyright © William Stallings /2 Memory Management.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
MEMORY MANAGEMENT. memory management  In a multiprogramming system, in order to share the processor, a number of processes must be kept in memory. 
Chapter 7 Memory Management
Memory Management Chapter 7.
Memory Management By: Piyush Agarwal ( ) Akashdeep ( )
Chapter 2 Memory and process management
Memory Allocation The main memory must accommodate both:
Memory Management © 2004, D. J. Foreman.
Chapter 8 Main Memory.
Main Memory Management
Module IV Memory Organization.
Chapter 8: Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Chapter 8: Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Multistep Processing of a User Program
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
So far… Text RO …. printf() RW link printf Linking, loading
Chapter3 Memory Management Techniques
Main Memory Background Swapping Contiguous Allocation Paging
CS399 New Beginnings Jonathan Walpole.
Chapter 8: Memory management
Outline Module 1 and 2 dealt with processes, scheduling and synchronization Next two modules will deal with memory and storage Processes require data to.
Lecture 3: Main Memory.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Page Main Memory.
Presentation transcript:

Memory management

Instruction execution cycle Fetch instruction from main memory Decode instruction Fetch operands (if needed0 Execute instruction Store result in memory if needed At least one memory access per instruction!

Process of compiling, linking and loading Compiling: Take program high level language and convert into object programs Linker: Take several object programs, resolve external references and perform relocation; result: load module Loader: loads load module in memory

Kinds of addresses Source program Object module Running program Symbolic addresses Relocatable addresses Absolute address

I. Simple memory allocation Only 1 user. Partition into two parts--OS part and user part Have bounds register (has smallest permitted address for user program) OS can access entire memory; user can access only user part (except through some trap instructions)

II. Static partitioned allocation Memory is divided into a fixed number of user partitions (plus an OS partition). Number and size of individual partitions do not change. Managing storage Allocation/De-allocation

Managing storage Maintain a table Location, size and status (in use or free) Deallocation: Set status to free Executed when a process terminates and its memory is to be freed

Allocation Search for the partition that is free and is big enough for the program that needs it. Two searching schemes First-fit: Search table equentially for the first free partition of sufficient size Best-search: Search for the smallest free partition of sufficient size

Dynamic partitioned allocation Number of size of partitions will vary with time. Initially, one big free partition. Issues: Managing memory Deallocate Allocate

Managing memory Maintain a linked list of free space. Update the list when doing deallocation or allocation

Deallocation Insert the partition into the free list. Merge with adjacent free partition(s) if possible.

Allocation First fit allocation Best fit allocation algorithm Search list and find the first free partition that is sufficiently large for the requested process Best fit allocation algorithm Find the smallest free partition that is sifficient Worst fit Find the largest free partition (not good in practice)

External fragmentation Free memory is partitioned into large number of small spaces; cannot allocate to a process that needs it. In terms of the extent of external fragmentation, there is no clear choice between first fit and best fit; There are instances when one is better than the other

Compaction Move free memory together to make one large free partition Moving programs is expensive (moving time is proportional to program size) Determining the optimal way to move programs: NP-hard problem

Segmentation Break the program into modules (based on how the program is written; use compiler help). Allocate each module separately. Fragmentation problem is smaller since we do not have large program sizes

Dynamic address translation in segmentation Each address is of the form (s,o) where s is the segment number and o is the offset. At run time, find the beginning absolute address of segment s, check that offset o is less than or equal to segment size and absolute address = starting address+o

Dynamic address translation Use the segment table if there are n segments (modules) for a program, the table has n rows Each row has two components: size and starting address of that segment in main memory