FIT2100 Lecture Notes - Lecture 9: Operating System, Computer Multitasking
![](https://new-preview-html.oneclass.com/lAX98ZbWJYdojKx4Gk73Nn0grqyDPwa7/bg1.png)
Virtual Memory (Lecture 9)
Virtual Management: Terminology
Virtual Memory: A storage scheme in which secondary memory can be addressed as though it
were part of main memory. The addresses a program may use to reference memory are
distinguished from the addresses the memory system uses to identify physical storage sites, and
program-generated addresses are translated automatically to the corresponding machine address
Virtual Address: The address assigned to a location in virtual memory to allow that location to be
accessed as though it were part of main memory
Virtual Address Space: The virtual storage assigned to a process
Address Space: The range of memory addresses available to a process
Real Address: The address of a storage location in main memory
Hardware and Control Structures
-Two characteristics fundamental to memory management:
1. All memory references are logical addresses that are dynamically translated into physical
address at run time
2. A process may be broken up into a number of pieces that don’t need to be contiguously
located in main memory during execution
*If these 2 characteristics are present, it is not necessary that all of the pages or segments of a
process be in main memory during execution
Virtual Memory
-Memory on disk
-Allows for effective multiprogramming and relieves the user of tight constraints of main memory
-Real memory is main memory on the actual RAM
-For virtual memory to be practical and effective:
-Hardware must support paging and segmentation
-Operating system must include software for managing movement of pages and/or segments
between secondary memory and main memory
Virtual Memory: Paging
-The term virtual memory is usually associated with systems that employ paging
-Each process has its own pageable
-Each page table entry contains the frame number of the corresponding page in main
memory
Thrashing: A state in which the system spends most of its time swapping process pieces rather
than executing instructions
-to avoid this, OS tries to guess, based on recent history, which pieces are least likely to be used
in the near future
Principle of Locality:
-Program and data references within a process tend to cluster
-Only a few pieces of a process will be needed over a short period of time
-Temporal locality: the instructions in a loop all reside in the cache
-Spatial locality: accessing the elements of an array and also the instructions in a loop
Virtual Memory: OS Policies
-Key performance issues — minimise page fault rate
Fetch Policy
-Determine when a page should be brought into main memory
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Virtual memory: a storage scheme in which secondary memory can be addressed as though it were part of main memory. The addresses a program may use to reference memory are distinguished from the addresses the memory system uses to identify physical storage sites, and program-generated addresses are translated automatically to the corresponding machine address. Virtual address: the address assigned to a location in virtual memory to allow that location to be accessed as though it were part of main memory. Virtual address space: the virtual storage assigned to a process. Address space: the range of memory addresses available to a process. Real address: the address of a storage location in main memory. * if these 2 characteristics are present, it is not necessary that all of the pages or segments of a process be in main memory during execution. Allows for effective multiprogramming and relieves the user of tight constraints of main memory.