Ch08 OS9e
Ch08 OS9e
Systems:
Internals
and Design Chapter 8
Principles Virtual
Memory
Ninth Edition
William Stallings
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved. Continued . . .
Execution of a Process
Piece of process that contains the logical address is
brought into main memory
Operating system issues a disk I/O Read request
Another process is dispatched to run while the disk I/O takes
place
An interrupt is issued when disk I/O is complete, which causes
the operating system to place the affected process in the Ready
state
Example
of Page
Sizes
Contemporary programming
techniques used in large programs
Most obvious on
tend to decrease the locality of
personal computers
references within a process where applications are
becoming increasingly
complex
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Segmentation
Segmentation allows the programmer to view memory as
consisting of multiple address spaces or segments
Advantages:
In a combined
Segmentation is visible to the
paging/segmentation system a programmer
user’s address space is broken
up into a number of segments.
Each segment is broken up into
a number of fixed-sized pages
Paging is transparent to the
which are equal in length to a programmer
main memory frame
Determines when a
page should be Two main
brought into memory types:
Demand
Prepaging
Paging
simpler page
replacement
policy
Free page list Modified page list
Local
• Chooses only among the resident pages of the process that generated the
page fault
Global
• Considers all unlocked pages in main memory
Key elements:
• Criteria used to determine
resident set size
• The timing of changes
The number of
The minimum The maximum page faults that
duration of the duration of the are allowed to
sampling sampling occur between
interval interval sampling
instances
Demand Cleaning
A page is written out to secondary memory only when it has been selected for
replacement
Precleaning
Allows the writing of pages in batches
UNIX SVR4
Memory
Management
Parameters
(page 1 of 2)
• Process virtual
Two memory
main • Kernel memory
aspe allocation
cts
Each entry points to one page Each entry points to one page Each entry refers to one virtual
of the page middle directory in the page table page of the process
These include:
ASHMem
This feature provides anonymous shared memory, which abstracts memory as file
descriptors
A file descriptor can be passed to another process to share memory
Pmem
This feature allocates virtual memory so that it is physically contiguous
This feature is useful for hardware that does not support virtual memory
Low Memory Killer
This feature enables the system to notify an app or apps that they need to free up
memory
If an app does not cooperate, it is terminated
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Summary
Hardware and control structures UNIX and Solaris memory
Locality and virtual memory management
Paging Paging system
Segmentation Kernel memory allocator
Combined paging and
segmentation
Linux memory management
Protection and sharing Linux virtual memory
Kernel memory allocation
OS software
Fetch policy Windows memory management
Placement policy Windows virtual address
Replacement policy map
Resident set management Windows paging
Cleaning policy Windows swapping
Load control
Android memory management
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.