CS300 Exam 2 || 100% Errorless Solutions.
Why might first-fit be better than worst-fit? correct answers First fit might be better if the
processes vary in size with multiple larger blocks. Worst fit would fill up large holes first, and
have no room when large blocks come.
What part of the MMU adds protection during contiguous allocation? correct answers Bounds
register provides protection by checking if memory references are within bounds.
What is thrashing? Can local page replacement fix thrashing? Why or why not? correct answers
Thrashing is when a program does not have enough frames and frequently has to replace. Page
replacement helps by keeping thrashing programs isolated, but the thrashing program will still be
constantly in the queue thus slowing down other programs.
What is stored in the page table that assists with optimizing page table replacement? Explain its
function. correct answers Modified bit indicates whether corresponding page has been modified
to minimize movement to disk
What is internal fragmentation? correct answers allocated memory may be slightly larger than
requested memory; this size difference is memory internal to a partition, but not being used
What is external fragmentation? correct answers a situation in which the dynamic allocation of
memory creates unusable fragments of free memory between blocks of busy, or allocated,
memory
What is the advantage and disadvantage to using larger pages? correct answers Larger pages
mean smaller page tables and less I/O, but more internal fragmentation.
Explicit correct answers uses the most significant bits to tell what segments and thus what base
value to use
Implicit correct answers Hardware determines the segment based on how the address was
formed.
What is the advantage of abstracting the process address space to logical addressing? Explain
why this is an advantage. Be specific and use operating system terms in your answer. correct
answers By abstracting the process address space memory may be managed more efficiently.
Allowing access to physical addresses places the burden of memory optimization on the
programmer. Moreover memory almost certainly performs better in a real world system when it
is allowed to choose its physical address at runtime (prevent faulting)
Name two factors that can be used to choose/more efficiently vary the allocation of frames given
to a process. correct answers Temporal locality - preserve recently used memory in hopes it will
be used again soon
, Spatial locality - preserve memory locations in close proximity to recently used memory in hopes
it will be used soon
Segmentation vs Paging correct answers *Paging*
one contiguous address space, equal-sized partitions where each virtual page is mapped to a
physical frame.
*Segmentation*
providing multiple logical address spaces for each process, where each segment can have a
different size.
*Advantages*
segmentation: the ability to create multiple variable-size address spaces.
paging: the ability to place any page into any frame in memory
*Disadvantages*
paging: external fragmentation
segmentation: internal fragmentation.
Does using a pure segmentation based memory approach address external fragmentation? Why
or why not? correct answers No, as memory is allocated and deallocated there is nothing
controlling the size or location of uncontrolled memory.
Does using a pure segmentation based memory approach address the issue of sparse address
spaces? Why or why not? correct answers Yes
Hierarchical page table correct answers divides page table into page-sized groups of entries
pointed to by a page directory;
*Advantages*
• reduces page table size by not allocating pages of the page table if none of its entries are used;
• allows groups of PTEs to be placed non-contiguously (level of indirection)
*Disadvantages*
• increases complexity and incurs time-space trade-off (as more memory accesses have to be
done with each level of indirection)
Inverted Page Table correct answers Page table which has one entry for each frame of memory.
Entries consist of the virtual address of the page stored in the frame. A single page table is used
to represent the paging information of all the processes.
*Advantages*
• Reduced memory space
• only fixed portion of memory is required to store paging information for all processes
Why might first-fit be better than worst-fit? correct answers First fit might be better if the
processes vary in size with multiple larger blocks. Worst fit would fill up large holes first, and
have no room when large blocks come.
What part of the MMU adds protection during contiguous allocation? correct answers Bounds
register provides protection by checking if memory references are within bounds.
What is thrashing? Can local page replacement fix thrashing? Why or why not? correct answers
Thrashing is when a program does not have enough frames and frequently has to replace. Page
replacement helps by keeping thrashing programs isolated, but the thrashing program will still be
constantly in the queue thus slowing down other programs.
What is stored in the page table that assists with optimizing page table replacement? Explain its
function. correct answers Modified bit indicates whether corresponding page has been modified
to minimize movement to disk
What is internal fragmentation? correct answers allocated memory may be slightly larger than
requested memory; this size difference is memory internal to a partition, but not being used
What is external fragmentation? correct answers a situation in which the dynamic allocation of
memory creates unusable fragments of free memory between blocks of busy, or allocated,
memory
What is the advantage and disadvantage to using larger pages? correct answers Larger pages
mean smaller page tables and less I/O, but more internal fragmentation.
Explicit correct answers uses the most significant bits to tell what segments and thus what base
value to use
Implicit correct answers Hardware determines the segment based on how the address was
formed.
What is the advantage of abstracting the process address space to logical addressing? Explain
why this is an advantage. Be specific and use operating system terms in your answer. correct
answers By abstracting the process address space memory may be managed more efficiently.
Allowing access to physical addresses places the burden of memory optimization on the
programmer. Moreover memory almost certainly performs better in a real world system when it
is allowed to choose its physical address at runtime (prevent faulting)
Name two factors that can be used to choose/more efficiently vary the allocation of frames given
to a process. correct answers Temporal locality - preserve recently used memory in hopes it will
be used again soon
, Spatial locality - preserve memory locations in close proximity to recently used memory in hopes
it will be used soon
Segmentation vs Paging correct answers *Paging*
one contiguous address space, equal-sized partitions where each virtual page is mapped to a
physical frame.
*Segmentation*
providing multiple logical address spaces for each process, where each segment can have a
different size.
*Advantages*
segmentation: the ability to create multiple variable-size address spaces.
paging: the ability to place any page into any frame in memory
*Disadvantages*
paging: external fragmentation
segmentation: internal fragmentation.
Does using a pure segmentation based memory approach address external fragmentation? Why
or why not? correct answers No, as memory is allocated and deallocated there is nothing
controlling the size or location of uncontrolled memory.
Does using a pure segmentation based memory approach address the issue of sparse address
spaces? Why or why not? correct answers Yes
Hierarchical page table correct answers divides page table into page-sized groups of entries
pointed to by a page directory;
*Advantages*
• reduces page table size by not allocating pages of the page table if none of its entries are used;
• allows groups of PTEs to be placed non-contiguously (level of indirection)
*Disadvantages*
• increases complexity and incurs time-space trade-off (as more memory accesses have to be
done with each level of indirection)
Inverted Page Table correct answers Page table which has one entry for each frame of memory.
Entries consist of the virtual address of the page stored in the frame. A single page table is used
to represent the paging information of all the processes.
*Advantages*
• Reduced memory space
• only fixed portion of memory is required to store paging information for all processes