CS 147 Virtual Memory Prof. Sin Min Lee Anthony Palladino.

Slides:



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

Part IV: Memory Management
Recap. The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of the.
Multiprocessing Memory Management
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Computer Organization and Architecture
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy (Part II)
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Paging. Memory Partitioning Troubles Fragmentation Need for compaction/swapping A process size is limited by the available physical memory Dynamic growth.
Review of Memory Management, Virtual Memory CS448.
Dynamic Partition Allocation Allocate memory depending on requirements Partitions adjust depending on memory size Requires relocatable code –Works best.
Memory Management. Process must be loaded into memory before being executed. Memory needs to be allocated to ensure a reasonable supply of ready processes.
1. Memory Manager 2 Memory Management In an environment that supports dynamic memory allocation, the memory manager must keep a record of the usage of.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Virtual Memory CS Introduction to Operating Systems.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
IT253: Computer Organization
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Lecture 11 Page 1 CS 111 Online Memory Management: Paging and Virtual Memory CS 111 On-Line MS Program Operating Systems Peter Reiher.
CE Operating Systems Lecture 14 Memory management.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Virtual Memory 1 1.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Memory.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Operating System Concepts and Techniques Lecture 9 Memory Management-2 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques,
Memory Management Chapter 5 Advanced Operating System.
1 Memory Management n In most schemes, the kernel occupies some fixed portion of main memory and the rest is shared by multiple processes.
CS203 – Advanced Computer Architecture Virtual Memory.
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.
CS703 - Advanced Operating Systems By Mr. Farhan Zaidi.
CS161 – Design and Architecture of Computer
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Memory Management Virtual Memory.
Paging.
Memory Management.
CE 454 Computer Architecture
Chapter 2 Memory and process management
Memory COMPUTER ARCHITECTURE
Chapter 8: Main Memory.
CSE 120 Principles of Operating
Outline Paging Swapping and demand paging Virtual memory.
ITEC 202 Operating Systems
Chapter 9 – Real Memory Organization and Management
Main Memory Management
Chapter 8: Main Memory.
CSCI206 - Computer Organization & Programming
O.S Lecture 13 Virtual Memory.
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Computer Architecture
Operating Systems.
CSE 451: Operating Systems Autumn 2005 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Operating Systems Concepts
COMP755 Advanced Operating Systems
Virtual Memory 1 1.
Presentation transcript:

CS 147 Virtual Memory Prof. Sin Min Lee Anthony Palladino

VIRTUAL MEMORY

Why Virtual Memory? When computers were first being developed, memory was very costly and hard to come by. Computers were the size of warehouses, yet often only had memory which amounted to 128 kilobytes. The complication of running out of memory space during run-time began to surface and a solution was needed in order to alleviate this problem. A way to provide nearly limitless cheap memory was sought by programmers. What was developed was virtual memory.

Initial Problems Many early programmers thought it too strange a concept to be pursued, and argued against it. Addressing initially was a problem before a stable process was developed. Many thought that virtual memory would simply be to expensive to implement correctly, as well as use too large a portion of the processors power. It was unclear at first how to mass produce the process for home use.

Some Terminology Virtual Memory- VRAM- Virtual Random Access Memory Physical Memory – Actually hardware memory MMU – Memory management Unit Real Address – Physical address in memory Virtual address – address of virtual memory Memory address – address of physical memory

Virtual Memory Features Virtual memory is much larger than real memory. Today’s Primary job for virtual memory is to avoid software conflicts. Conversions are done on the Page tables. MMU Controls the process. The TLB allows for paging to remain fast. Programs are no longer limited by amount of real memory. (much larger problem when computers were first being developed)

Virtual Memory Drawbacks Addressing is more difficult Conflicts can terminate programs Disk drive is much slower than memory (thousands to millions of times)

How can programs be separated? At any given time, only a fraction of a program is running (90/10 Rule) Only parts needed for immediate execution, or that are used repeatedly are loaded. Less accessed parts are left on disk and out of memory in order to save space. (programs can be several gigs these days, much too big for the amount of memory most people have in their computers)

Virtual Addressing Virtual memory must use a smart memory controller that can convert between the byte and word addressing, between the two memory systems. This was later designed to be done without arithmetic computation, so that the CPU would not lose much processing power. The easiest way to implement this was by keeping everything in powers of two. Virtual Memory is not part of the actual underlying physical memory. Each Program is able to operate in its own virtual address space

Virtual Memory Interface Virtual memory is able to use complex memory organization structures, primarily through the use of the MMU previously mentioned. This can be complicated as different types of memory (such as SRAM and DRAM) use different word sizes. Additionally, RISC processors discussed previously in class have access to more than one memory structure. The MMU is at the root of all virtual memory control.

MMU The MMU is a processor run controller that handles the memory. It serves as a hardware translator, doing conversions The MMU is able to connect memories with different word sizes, as well as virtual and real. As far as the processor knows, there is one large memory, with one set of addresses.

Mapping and Arithmetic Memory addressing is started from zero, and this is expect, so the MMU does proper adjustments to keep this illusion. This helps in simulating one large contiguous memory. In order to keep the MMU from having to do intense mathematical calculations in order maintain memory structure (such as subtraction), it finds boundaries in powers of two, allowing the lower-order bits to easily be used in the addressing scheme. When a computer is created, the virtual memory is determined. When a user adds or removes physical memory, it may create a hole, or a place where virtual memory cannot be mapped to physical. This can create an error due to discontinuity.

Dynamic creation of Virtual Memory The processor can determine the mappings before running, determining what is needed and what is not. The processor then switches to real mode, using only the physical memory. Finally, after mapping is done, the MMU is enabled.

Paging Paging was developed as a more efficient replacement for segmentation. Memory is broken into blocks with equal sizes, known as pages. Paging’s efficiency relies on page replacement, which moves the least likely need paged out of physical memory. The page system often relies on a power of two system, again to avoid costly arithmetic calculations. The MMU controls the page table.

Blocks and Paging Paging is controlled by the Page Map The Virtual address space is separated into portions known as pages. Physical memory is separated into pieces known as page frames. Pieces are all of equal size.

The Page Table The page table is a structure controlled by the operating system. It contains the mapping of virtual addresses to their physical location in memory. Every process and program is given its own page table. The page table contains all possible page mappings.

Multiprogramming and Virtual Spaces Multiprogramming is designed so that multiple programs can be run at the same time. Early on, this was considered a bad idea, as memory conflicts could arise between the different programs, and both would end in abnormal termination. This could be solved by having programs designed to run intentionally using different memory addresses, but this a great deal more intensive, and requires much programming, while still being risky. To alleviate this problem, memory partitioning was developed. Virtual partitioned greatly increased the functionality of this, making it much more feasible. One limitation of the process is that it limits the total memory available to any given process.

END