Computer Science 330
Operating Systems
Fall 2022, Siena College
Lecture 0x12: Virtual Memory
Date: Friday, December 2, 2022
Agenda
- Announcements
- Sign up for the CS Holiday Party! We need to send catering numbers today.
- Programming Project 4: Roger Bacon Shell with Pipes and
Redirection [HTML] [PDF] hard deadline on Wednesday
- If you haven't completed the readings/activities from OS zyBook: Chapter 8, get them done before we talk about that chapter on Monday
- The next (and last) readings/activities from OS zyBook: Chapter 9, due Friday, December 9
- Frame allocation
- each process needs some number of frames
- pages for instructions, local data, global data
- how do we decide how many frames are allocated to each
process?
- equal allocation - everyone gets the same
- proportional allocation - processes get frames
proportional to the amount of logical memory
- priority allocation - prioritize memory like we
prioritize CPU scheduling
- local replacement vs. global replacement - does a victim
have to be selected from the page faulting process' frames?
- thrashing
- if we have too many processes, not enough frames to
keep a reasonably low page fault rate
- the medium-term scheduler may notice a low CPU
utilization (everyone's waiting on page faults) and add
more processes to the mix
- this will only make the situation worse
- need to be able to detect this and have the
medium-term or long-term scheduler reduce the degree of
multiprogramming
- Working set model
- each process will have a set of pages on which it is
working frequently at a given time
- this is the working set of a process
- a process' working set changes over time
- approximate the working set as the set of pages that
a process has accessed within some window of time into the
recent past
- if this working set window is too small, the working
set we detect will not encompass the true locality
- if it is too large, pages will remain in the working
set too long after the process has moved on
- total demand for frames in the system is the sum of
the working sets of all processes
- thrashing is likely when this total demand outstrips
availability
- this is used in reality in many modern systems
(Solaris, Windows, to name two)
- we will look more closely at this in a Friday lab exercise
- Combinations of Segmentation and Paging
- Intel Pentium memory hardware
- Looking at the exercises for OS zyBook Chapter 7
- Section 7.2, all
- Section 7.3, all
- Section 7.4, all
- Section 7.5, all
- Lab 8: Working Set Simulation [HTML] [PDF]