Memory Management Overview
- 30Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the key task of a modern operating system regarding memory?
To allow running multiple applications at once by managing memory, preventing processes from overwriting each other's memory.
Or swipe the card
30 cards
What is the key task of a modern operating system regarding memory?
To allow running multiple applications at once by managing memory, preventing processes from overwriting each other's memory.
Why can't a program run directly from disk?
Because the CPU can only access main memory and its registers; programs must be copied into memory to execute.
What are base and limit registers used for?
To define a process's memory region: base is the starting address, limit is the size of the allowed memory space.
How does hardware address protection check a memory access?
It checks if the requested address is ≥ base and < base+limit. If both conditions hold, access is allowed; otherwise, an error is generated.
What is the performance cost of a cache miss (stall)?
The CPU stalls (waits) for the memory access, unable to do anything else during that time.
What is address binding?
The mapping of a program's symbolic addresses to physical memory addresses.
What is the difference between logical and physical addresses?
Logical address is the CPU-generated address (relative to process start); physical address is the actual memory location.
What is the role of the Memory Management Unit (MMU)?
To map logical addresses to physical addresses, enabling relocation and protection using hardware registers.
What is dynamic linking?
A technique where libraries (DLLs) are loaded into memory only when needed, rather than at compile time.
What is the purpose of swapping?
To move processes between main memory and backing storage (disk) to free up memory when needed.
What is the main disadvantage of swapping?
It is slow due to disk I/O, especially with hard disks, causing performance degradation.
What is contiguous memory allocation?
Each process occupies a single contiguous block of memory, with no gaps within the block.
Explain first-fit memory allocation.
Allocate the first hole in memory that is large enough for the process.
Explain best-fit memory allocation.
Allocate the smallest hole that is large enough for the process, minimizing wasted space.
Explain worst-fit memory allocation.
Allocate the largest hole available, leaving a big leftover hole.
What is external fragmentation?
Total free memory is enough to satisfy a request, but the free space is scattered in small holes, not contiguous.
What is internal fragmentation?
Wasted memory within an allocated block because the allocated space is larger than the process needs.
What is compaction?
Shuffling memory contents to place all free memory together in one large block, eliminating external fragmentation.
What is the average internal fragmentation in paging?
Half of a page size.
What is segmentation?
Memory management scheme where a process is divided into variable-sized segments (e.g., code, data, stack).
What is paging?
Memory management scheme that divides physical memory into fixed-sized frames and logical memory into pages of the same size.
What is a page table?
A data structure that maps each page of a process to the corresponding frame in physical memory.
How does address translation work in paging?
The logical address is split into a page number and an offset. The page number indexes the page table to get the frame number; then the offset is added to form the physical address.
What is a Translation Lookaside Buffer (TLB)?
A hardware cache that stores recent page-to-frame mappings, enabling parallel search and faster address translation.
How does a TLB improve performance?
By searching all entries in parallel; if a mapping is found (hit), the frame number is obtained quickly without a full memory access to the page table.
What is effective access time (EAT) in the context of TLB?
The average time to access memory, considering TLB hit ratio: EAT=(hitratioimesTLBhittime)+(1−hitratio)imesTLBmisstime.
In the example, with 80% TLB hit ratio, what is the effective access time if TLB search takes 20 ns and memory access 100 ns?
EAT=0.8imes(20+100)+0.2imes(20+100+100)=96+44=140extns
What is a valid-invalid bit in a page table?
A bit indicating whether a page is in memory (valid) or not (invalid, e.g., swapped out or not allocated).
What is reentrant code?
Code that can be shared among multiple processes because it does not modify itself and uses separate data per process.
How does the OS handle shared code in paging?
Multiple processes can map to the same frames for read-only code, while each has its own private pages for data.

Ask anything
We've read this whole study set, so questions about it get the best answers.