- Memory management system?
Internal Fragmentation: Wasted space within a unit of allocation
External Fragmentation: Wasted space between units of allocation
(b) [3pts] Why do we consider fragmentation to be a problem?
It’s wasted space
External fragmentation
(b) [2pts] How do we eliminate that fragmentation with static relocation?
We don’t
(c) [2pts] How do we eliminate that fragmentation with dynamic relocation?
Defragmentation (Compaction)
Paging divides a process’s virtual address space into equally-sized pieces.
1. [2pts] How does the size of the virtual address space relate to the size of the physical address space?
The virtual address space is usually much bigger than the physical
2. One day, at home, for fun, you decide to write a program in C. Unfortunately, your program is very buggy (Did you just add a ’*’ ?), and so you use gdb to find and eliminate the bugs.
(a) [4pts] You print a stack backtrace, and gdb displays the stack along with the address of
each function call. Are these addresses virtual or physical?
Virtual
(b) [10pts] How would the system use that address to access the data it represents? Please
describe the steps of the process in a numbered list, and please be sure to include the TLB! Each step should be no more than twenty words.
(1) A concurrent request is sent to the TLB and the page table to find the translation of page number to frame number.
(2) If the translation is found in the TLB, then the request to the page table is stopped, and the frame number is returned.
(3) If the translation is not found, the translation is found in the page table and the translation is added to the TLB.
(4) The offset from the virtual address is added to the frame number to get the physical address.
As we studied virtual memory, we discovered that there are many places to improve efficiency, and therefore there are many policy decisions to be made. We discovered that many policies exist, largely because there are advantages and disadvantages to each.
It doesn’t load in pages until you need them, preventing unnecessary work
Pre-paging might increase efficiency if you load in all the right pages because it will result in less page faults
It is important because it will run on every page fault, and will affect to the overall efficiency of the system
Working set will decrease the amount of times the page fault handler needs to run by preemptively evicting pages and not letting memory fill up.
Larger page size can increase time efficiency because the system will page-fault less and increase space efficiency because the page table is smaller.
Relocation
One of the memory management techniques we studied is known as relocation.
1. [4pts] What is the main idea behind relocation?
Increase degree of multi-programming
Physical address.
Virtual address.
Virtual address.
External
(b) [2pts] Paging
Internal
(c) [2pts] Contiguous files
External
(d) [2pts] Linked files
Internal
(e) [2pts] Multilevel Indexed Files
Internal
Memory Management
On just another day at AwesomeCompany, your fellow employee approaches you and comments that the paging system in use by AwesomeCompany’s OS seems unnecessarily complex, and that it would be simpler and more efficient to just place the processes contiguously in physical memory.
1. [4pts] Name two advantages to the suggested policy.
Less complex.
No overhead of page table lookup.