Virtual Memory Flashcards
(16 cards)
What is virtual memory?
Abstraction layer that gives program feeling of a big block of contiguous memory
Virtual memory allows for efficient memory management by creating an illusion of a large memory space.
What is the key idea of the working set algorithm?
Must allocate enough frames to process the current locality
The working set algorithm helps to avoid thrashing by ensuring that enough memory is allocated for the active set of pages.
Define page fault frequency.
An acceptable page fault rate
A high page fault frequency indicates that a process requires more frames, while a low frequency suggests that a process can afford to lose a frame.
What are memory mapped files?
Logical connection between file and chunk of memory on the SSD
Memory mapped files improve performance by allowing files to be read using demand paging.
What is memory mapped I/O?
Allows more convenient access to I/O devices
Memory mapped I/O simplifies operations for the operating system by enabling read/write from special memory locations.
What is kernel memory?
Needs to be physically contiguous and allocated from memory pool
Kernel memory management is essential for system stability, and it often uses the buddy system or slab allocation.
What is the buddy system?
Manages physically contiguous blocks by allocating memory in powers of 2
The buddy system rounds up memory requests to the next power of 2, which can lead to memory wastage.
What is slab allocation?
Comprises one or more physically contiguous pages
Slab allocation reduces the cost of finding, allocating, and freeing objects in memory.
What are the advantages of smaller pages?
Less internal fragmentation
Smaller pages can lead to more efficient memory use, but may not hold larger objects.
What are the advantages of large page tables?
Fewer pages needed, smaller page tables
Large pages are beneficial for big applications like databases, but can lead to wasted space with many small processes.
What is locality in memory management?
Programs tend to reuse data and instructions
Locality includes spatial locality (neighboring locations are likely accessed) and temporal locality (recently accessed locations are likely accessed again).
What is thrashing?
Occurs when the size of the locality exceeds the total memory size
Thrashing can severely degrade system performance due to excessive page faults.
What is a working set window (delta)?
Most recent page references is delta. Looks back at last delta time units that it took to run a process. If delta is 10ms, the working set window is the last pages touched in the last 10ms
The size of the working set window is critical in managing memory effectively and preventing thrashing.
Fill in the blank: If delta is too small, it fails to encompass _______.
entire locality
Adjusting the delta size is important for accurately capturing memory usage patterns.
Fill in the blank: If delta is too big, you might include pages from past _______ that are not active anymore.
localities
This can lead to inefficient memory allocation and potential thrashing.
True or False: If delta is infinite, it contains all pages accessed by the process during execution.
True
An infinite delta would capture the entire history of memory accesses, which may not be practical.