0% found this document useful (0 votes)
6 views

lecture_slides_09_091-vmoverview

The document provides an overview of virtual memory (VM) and its significance in computer science, particularly in relation to processes and memory management. It explains how VM allows programs to use logical control flow and private virtual address spaces, while addressing challenges such as memory fitting, management, protection, and sharing. Additionally, it includes examples of memory allocation and the differences between virtual and physical memory.

Uploaded by

yihuangece
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

lecture_slides_09_091-vmoverview

The document provides an overview of virtual memory (VM) and its significance in computer science, particularly in relation to processes and memory management. It explains how VM allows programs to use logical control flow and private virtual address spaces, while addressing challenges such as memory fitting, management, protection, and sharing. Additionally, it includes examples of memory allocation and the differences between virtual and physical memory.

Uploaded by

yihuangece
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

University of Washington

Memory & data


Roadmap Integers & floats
C: Machine code & C
Java:
x86 assembly
car *c = malloc(sizeof(car)); Car c = new Car(); Procedures & stacks
c->miles = 100; c.setMiles(100);
Arrays & structs
c->gals = 17; c.setGals(17);
float mpg = get_mpg(c); float mpg = Memory & caches
free(c); c.getMPG(); Processes
Virtual memory
Assembly get_mpg: Memory allocation
pushq %rbp Java vs. C
language: movq %rsp, %rbp
...
popq %rbp
ret
OS:
Machine 0111010000011000
100011010000010000000010
code: 1000100111000010
110000011111101000011111

Computer
system:

Virtual Memory Overview


University of Washington

Section 9: Virtual Memory (VM)


 Overview and motivation
 Indirection
 VM as a tool for caching
 Memory management/protection and address translation
 Virtual memory example

Virtual Memory Overview


University of Washington

Processes
 Definition: A process is an instance of a running program
 One of the most important ideas in computer science
 Not the same as “program” or “processor”

 Process provides each program with two key abstractions:


 Logical control flow
 Each process seems to have exclusive use of the CPU
 Private virtual address space
 Each process seems to have exclusive use of main memory

 How are these illusions maintained?


 Process executions interleaved (multi-tasking) – last section
 Address spaces managed by virtual memory system – this section!
Virtual Memory Overview
University of Washington

Virtual Memory (Previous Lectures)


 Programs refer to virtual memory addresses FF∙∙∙∙∙∙F
 movl (%ecx),%eax
 Conceptually memory is just a very large array of bytes
 Each byte has its own address
 System provides address space private to particular “process”
 Allocation: Compiler and run-time system
 Where different program objects should be stored
 All allocation within single virtual address space

 What problems does virtual memory solve?

00∙∙∙∙∙∙0

Virtual Memory Overview


University of Washington

Problem 1: How Does Everything Fit?


64-bit addresses: Physical main memory:
16 Exabyte Few Gigabytes

And there are many processes ….


Virtual Memory Overview
University of Washington

Problem 2: Memory Management


Physical main memory

Process 1
stack
Process 2
Process 3

x heap
.text
.data
What goes
where?

Process n …

Virtual Memory Overview


University of Washington

Problem 3: How To Protect


Physical main memory

Process i

Process j

Problem 4: How To Share?


Physical main memory

Process i

Process j

Virtual Memory Overview

You might also like