Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic Memory Management 1. Readings r Silbershatz et al: chapters 8.1-8.2 2.

Similar presentations


Presentation on theme: "Basic Memory Management 1. Readings r Silbershatz et al: chapters 8.1-8.2 2."— Presentation transcript:

1 Basic Memory Management 1

2 Readings r Silbershatz et al: chapters

3 Outline r Memory Hierarchy r Memory management requirements 3

4 Introduction r Our machines today have 10,000 times more memory than the IBM 7094 – leading edge machine of the 1960’s r Cost of memory has dropped dramatically r Bill Gates (former chair of Microsoft) once said “640K should be enough” r There is a high-performance machine at Western (for bioinformatics research) with 1 terabyte of memory 4

5 Introduction r Software and data sets expand to fill the memory available m The 1 terabyte of memory – the researchers already want more r Technology does not allow for each program to have infinitely large and fast memory r Operating systems must manage memory 5

6 Introduction r Memory management requires m Keep track of what parts of memory are in use. m Allocate memory to processes when needed m Deallocate memory when processes are done 6

7 Instruction-Execution Cycle r You can think of memory as a large array of bytes m Each byte has its own address r Fetch an instruction from memory r Instruction is decoded m May cause operands to be fetched from memory r After instruction execution m Results may be stored back in memory r Each of these operations require memory addresses 7

8 Registers On-chip Cache Main Memory Disk Memory Hierarchy r Registers built into the CPU are generally accessible within one cycle of the CPU clock r Completing a memory access may take many cycles of the CPU clock 8

9 Memory Hierarchy r A processor waiting for data from main memory is not desired r Remedy: Add fast memory between the CPU and main memory called a cache 9

10 Memory Management r Memory is to be shared by multiple processes r Processes should not be able to reference another process’s memory without permission m This requires an ability to determine the range of legal addresses that the process may access 10

11 Address Binding r Program execution requires that a program be brought into memory from the disk r The process can reside in any part of the physical memory r Address space starts at but the first address of a user need not be

12 Address Binding r User program goes through several steps before it is ready to be executed r The binding of instructions/data to memory addresses can be done at any step along the way 12

13 Address Binding r Addresses in the source program are generally symbolic e.g., count r Compiler will bind these symbolic addresses to relocatable addresses m Example: “14 bytes from the beginning of this module” 13

14 Address Binding r The loader will in turn bind the relocatable addresses to absolute addresses 14

15 Address Binding r Execution time: m Binding to actual physical memory addresses must be delayed until run- time 15

16 Address Binding r Typically the programmer does not know where the program will be placed in memory when it is executed r While the program is executing, it may be placed in disk and returned to main memory at a different location (swapping) 16

17 Address Binding r Memory references in the code (virtual or logical) must be translated to actual physical memory addresses r Run-time Mapping from virtual to physical addresses is done by a hardware device called the memory-management unit (MMU) r Run-time mappings depend on how memory is allocated to processes 17


Download ppt "Basic Memory Management 1. Readings r Silbershatz et al: chapters 8.1-8.2 2."

Similar presentations


Ads by Google