



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various memory allocation techniques and algorithms, including demand paging, lru approximation algorithms, fixed allocation, equal allocation, proportional allocation, local replacement, global replacement, page fault frequency allocation, and overcommitting memory. Topics cover page fault handling, thrashing prevention, and working sets.
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




1
2
3
Load M
Free frame
Page table
ref
Page fault
Reference V R D W ReE Frame Address
Re fe re nce VRDW ReE Frame Add re ss
4
Initially 0, set to 1 on a reference
If reference bit = 0, replace the page If page to be replaced (in clock order) has reference bit = 1, then Set reference bit to 0 Leave page in memory Replace next page (in clock order) subject to same rules
7
instruction is 6 bytes, might span 2 pages 2 pages to handle from 2 pages to handle to
8
9
100 frames 5 processes Each process gets 20 frames
10
Run command parameters? Dynamically?
Each process has separate pool of pages Fixed number of pages (e.g., Digital VMS) Fixed fraction of physical memory (1/P) Proportional to size of allocated address space Page fault in one process only replaces pages of that process Perform replacement (e.g., LRU) over only those pages Advantage No interference across processes Disadvantage Potentially inefficient allocation of memory How to handle sharing of pages across processes?
19
Drop a course
Determine how much memory each process needs Long-term scheduling policy Run only those processes whose memory requirements can be satisfied
20
A program clusters its access to data and text temporally A recently accessed page is more likely to be accessed again E.g., sequential ops - reading arrays, code pages
21
Set of pages process needs to avoid thrashing Requires knowing the future
Pages referenced by process in last ฮค seconds of execution Approximates locality principle
22
Set of pages process needs to avoid thrashing Requires knowing the future
Pages referenced by process in last ฮค seconds of execution Approximates locality
Cache partitioning: give each app enough space for WS Page replacement: preferentially discard non-WS pages Scheduling: process not executed (ready or running) unless WS in memory
At least allocate this many frames for this process
25
26
27
Moving window over reference string Approximate with Interval timer + a reference bit
Keep in memory 2 bits for each page Indicates if page was used within last 10,000 references Timer interrupts after every 5000 time units Shift 0 right If one of the bits in memory = 1 Page is in working set
Improvement - 10 bits and interrupt every 1000 time units (^28)
If the working set is correct Not many page faults
Control thrashing by establishing acceptable page-fault rate
If page fault rate increases beyond assumed knee of curve Increase number of page frames available to process If page fault rate decreases below foot of knee of curve Decrease number of page frames available to process.
Large page tables Minimizes internal fragmentation Good for locality of reference (~256) Page tables are larger Disk-seek time dominates transfer time (It takes almost the same time to read a large page as a small page)
Significant amounts of a page may not be referenced Enables more data per seek
Windows: default 8 KB Linux: default 4 KB