Main Memory Part 2 Flashcards
In Contiguous Memory Allocation, segments vary in ______, and the OS needs to find free space in memory for new address spaces
length
In contiguous memory allocation, the OS maintains lists on _________ space and _____ space to find holes to choose for new processes
allocated, free
What are the 3 fits an OS can give to a new process?
- First-fit
- Best-fit
- Worst-fit
In first-fit, the OS allocates _____ hole that is big enough
first
In best-fit, the OS allocates the _________ hole that is big enough.
smallest
In best-fit, the OS must ______ the entire list, unless ordered by ____
search, size
In best-fit, the OS produces the smallest _______ hole
leftover
In worst-fit, the OS allocates the ________ hole
largest
In worst-fit, the OS produces the _______ leftover hole
largest
Contiguous allocation is simple to ________ but can cause memory ________
implement, fragmentation
An issue that arises from external fragmentation is that there might be enough total memory space for ________, but it is not _________
allocation, contiguous
How does compaction solve the issue of external fragmentation?
It copies data to one contiguous chunk of memory
The main disadvantage of compaction is that is is _____
slow
What is internal fragmentation?
When allocated memory is larger than requested
Why does internal fragmentation occur?
It occurs when the system has fixed allocation sizes
Compaction cannot help internal fragmentation because the OS cannot control the memory once it is handed to the requesting ______
process
What are 4 memory allocation mechanisms?
- Splitting
- Coalescing
- Tracking allocated memory
- Tracking free memory
Splitting is when the OS finds a free chunk of ________ and splits it into two
memory
Splitting is useful when the ________ memory size is smaller than the size of free memory
requested
Coalescing is when the OS merges ________(______) memory chunks into a big chunk
returned, adjacent
The memory allocated is interfaced with ______ and ____
malloc, free
Allocated memory can store size information needed for _________ free space by storing it in a ______ block together with the allocated memory
managing, header
To track free memory,, the OS can _____ the list in memory
embed
REVIEW TRACKING FREE MEMORY SLIDES
REVIEW TRACKING FREE MEMORY SLIDES
In contiguous allocation, _________ for a segment or process must be contiguous
addresses
Non-contiguous allocation uses ________ to store processes
paging
Pages allows the underlying _______ memory and _______ to be decoupled
physical, segment
In non-contiguous allocation with paging, processes are ________ memory wherever it is available
allocated
Page frames are produced by dividing _______ ______
physical memory
The amount of page frames are usually a power of _
2
Pages are produced by dividing ______ ______
logical memory
Pages and page frames should be the same _____
size
For a program of size n pages, the OS needs to find _ free frames
n
What do page tables do?
Translates logical to physical addresses
With paging, addresses generated by the ___ is divided into page _______ and page ______
CPU, number, offset
What is a page number?
An index into the page table which contains the base address of each page in physical memory
What is a page offset?
A number that when combined with the base address defines the physical address sent to the memory unit
If the logical address space is 2^m bytes, what is the page size and number of pages?
- Page size: 2^n
- # of pages: 2^(m-n)
REVIEW PAGING EXAMPLE
REVIEW PAGING EXAMPLE
In the implementation of a page table, the page table is kept in _____ ________
main memory
In the implementation of a page table, the _________ _____ register points to the page table
page-table base
In the implementation of a page table, the __________ ______ register indicates the size of a page table
page-table length
In the implementation of a page table, what is a downside when keeping page tables in memory?
Every data/instruction access requires two memory accesses
In the implementation of a page table, why does every data/instruction require two memory accesses?
One for page table and one for data/instruction
In the implementation of a page table, slow data/instruction access can be solved with a …
translation look-aside buffer (TLB)
A translation look-aside buffer has ____–_____ associative memory, and _____ page table entries of currently running processes
fast-lookup, caches
The fast-lookup associative memory in the TLB typically contains ___ to _____ entries
32, 1024
The translation look-aside buffer is part of the _______ __________ unit
memory, management
REVIEW PAGING WITH TLB SLIDE
REVIEW PAGING WITH TLB SLIDE
When paging with TLB, when a TLB miss occurs, the page table is ________ and an entry is added to TLB for future _____ reference
consulted, fast
When paging with TLB, is the TLB is full during a miss, it _______ an existing entry
replaces
When paging with TLB, come entries cannot be _______, such as pages containing _____ code
removed, kernel
When paging with TLB, each entry stores an _______ ________ _______
address space identifier
When paging with TLB, ASIDs are an _______ for processes
identifier
When paging with TLB, ASIDs are referred to when translating _______
addresses
When paging with TLB, ASIDs allow the TLB to hold page table entries for ______ processes
multiple
Given - e = time for lookup in TLB - tm = memory access time - a = hit ratio, what is the effective access time for paging with TLB?
e + (2 - a)tm