What are the main tasks of memory management?
It tracks memory use, allocates and reclaims memory, translates addresses, and protects processes from one another.
Study 6 Memory Management and Virtual Memory with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What are the main tasks of memory management?
It tracks memory use, allocates and reclaims memory, translates addresses, and protects processes from one another.
How does a process’s address space relate to physical memory?
A process uses virtual addresses, which the memory-management unit translates into physical addresses in RAM. This abstraction lets programs work without knowing where data resides physically.
Which regions commonly appear in a process’s address space?
It commonly contains program code, global data, a heap for dynamically allocated memory, and a stack for function calls and local variables.
How do threads’ address spaces differ from those of separate processes?
Threads in one process typically share that process’s address space; separate processes normally have separate address spaces.
At which two levels does memory allocation occur?
A runtime allocator manages program-requested blocks and may request larger regions from the operating system. The operating system manages virtual-memory regions and physical page frames.
What is external fragmentation?
External fragmentation is free memory split into pieces too small to satisfy a request, even when the total free space may be sufficient.
How does paging organize virtual and physical memory?
Paging divides virtual address spaces into fixed-size pages and physical memory into same-sized page frames. Any available frame can hold a page, avoiding external fragmentation in physical-memory allocation.
With 4 KiB pages, how is address 0x12345 divided?
The virtual page number is 0x12, and the offset within that page is 0x345.
What does the translation lookaside buffer do?
The TLB caches recent address translations. A hit supplies a translation quickly; on a miss, the processor consults the page tables and may cache the result.
How does segmentation organize an address space?
Segmentation divides an address space into variable-sized logical regions, such as code, data, and stack. A segment’s base marks its start, and its limit gives its size.
What does virtual memory allow the operating system to do?
It lets an address space exceed the portion currently resident in RAM. Pages can be brought into RAM when needed, and mappings can also be backed by files.
What happens when an access triggers a page fault?
A valid access to a page not resident in RAM raises a page fault. The operating system may load the page, update the page table, and restart the instruction; an invalid or disallowed access instead causes an error or signal.