What is the main purpose of using paging in an operating system?
Think about how memory is managed to avoid fragmentation and simplify allocation.
Paging divides physical memory into fixed-size frames and virtual memory into pages. This allows the OS to map pages to frames flexibly, avoiding fragmentation and simplifying memory management.
Which of the following is NOT typically stored in a page table entry?
Consider what information is needed to translate virtual addresses to physical addresses.
Page table entries store the frame number, validity bit, and access permissions. The process ID is managed elsewhere, not in the page table entry.
An operating system uses 32-bit virtual addresses and a page size of 4 KB. How many entries does a single-level page table have?
Calculate the number of pages by dividing the virtual address space by the page size.
Virtual address space is 2^32 bytes. Page size is 4 KB = 2^12 bytes. Number of pages = 2^(32-12) = 2^20 = 1,048,576 entries.
Which statement correctly distinguishes internal fragmentation from external fragmentation in memory management?
Think about wasted space inside allocated blocks versus scattered free space outside allocated blocks.
Internal fragmentation is wasted space inside allocated memory blocks due to fixed block sizes. External fragmentation is free memory scattered in small pieces that can't be used effectively.
How does increasing the page size affect the size of the page table and the amount of internal fragmentation?
Consider how page size affects the number of pages and leftover space inside pages.
Larger page size means fewer pages, so the page table has fewer entries (smaller size). But larger pages cause more unused space inside pages, increasing internal fragmentation.