HomeSubjectsUniversityBlogAbout

Memory Management

Topic in Operating Systems

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

Memory management is how an operating system allocates main memory among processes and translates their logical addresses into physical ones. Early questions cover base and limit registers, contiguous allocation with first-fit, best-fit and worst-fit, and internal versus external fragmentation. The core of the topic is paging: splitting an address into page number and offset, page tables, multilevel and inverted page tables, and effective access time with a TLB. Virtual memory questions ask about demand paging, page faults, and page-replacement algorithms such as FIFO, Optimal and LRU, including Belady's anomaly. Segmentation, thrashing and the working-set model complete the usual syllabus.

Below are 30 practice questions from a pool of 210 Memory Management MCQs, one of 12 topics in Operating Systems. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Memory ManagementEasy

Q1. Paging divides:

  1. A.The disk into sectors and track clusters
  2. B.Processes into variable-size logical segments
  3. C.Physical memory into frames, logical into pages✓ Correct
  4. D.The CPU into separate processing partitions

Explanation

Paging divides physical memory into fixed-size blocks called frames and logical memory into blocks of the same size called pages. A page table maps pages to frames.

Report an error in this question

Memory ManagementMedium

Q2. The FIFO page replacement algorithm replaces:

  1. A.The page that has been in memory longest✓ Correct
  2. B.The least recently used page in memory
  3. C.The most frequently used page in memory
  4. D.A random page selected from the frames

Explanation

FIFO replaces the oldest page in memory (the one that was loaded first). It is simple but can suffer from Belady's anomaly where more frames can lead to more page faults.

Report an error in this question

Memory ManagementMedium

Q3. Belady's anomaly states that:

  1. A.More frames can increase faults for some algorithms✓ Correct
  2. B.More memory always reduces total page faults
  3. C.LRU always outperforms FIFO in every situation
  4. D.Optimal page replacement causes most page faults

Explanation

Belady's anomaly is the counterintuitive observation that for some algorithms (notably FIFO), increasing the number of available page frames can actually increase the number of page faults.

Report an error in this question

Memory ManagementMedium

Q4. In demand paging, pages are loaded into memory:

  1. A.All at once when the process first starts
  2. B.Based on a predetermined schedule
  3. C.Only when they are actually referenced✓ Correct
  4. D.Randomly without any specific order

Explanation

Demand paging loads a page into memory only when it is referenced (accessed). This is a lazy approach that avoids loading pages that may never be used, saving memory.

Report an error in this question

Memory ManagementEasy

Q5. Virtual memory allows:

  1. A.Only one process to run at any given time
  2. B.Programs larger than physical memory to execute✓ Correct
  3. C.Faster CPU execution by clock overclocking
  4. D.Direct access to underlying hardware devices

Explanation

Virtual memory allows the execution of programs that are larger than physical memory by keeping only necessary portions in RAM and storing the rest on disk, swapping pages as needed.

Report an error in this question

Memory ManagementEasy

Q6. A page fault occurs when:

  1. A.A referenced page is not in physical memory✓ Correct
  2. B.A page has become corrupted in memory
  3. C.The page table is completely full of entries
  4. D.A page is too large to fit in any frame

Explanation

A page fault occurs when a process tries to access a page that is mapped in its virtual address space but is not currently loaded in physical memory, requiring the OS to load it from disk.

Report an error in this question

Memory ManagementMedium

Q7. Thrashing occurs when:

  1. A.The CPU is idle and not running tasks
  2. B.Memory is completely free and available
  3. C.A process pages more than it executes✓ Correct
  4. D.Too few processes are currently running

Explanation

Thrashing occurs when a process does not have enough frames and constantly pages in and out. The system spends most of its time handling page faults instead of useful computation.

Report an error in this question

Memory ManagementMedium

Q8. The first-fit memory allocation algorithm:

  1. A.Allocates memory blocks at random
  2. B.Searches for the smallest suitable hole
  3. C.Allocates the first hole large enough✓ Correct
  4. D.Allocates the largest available hole

Explanation

First-fit allocates the first memory hole that is large enough to satisfy the request. It is fast because it doesn't need to search the entire list.

Report an error in this question

Memory ManagementEasy

Q9. Physical address is:

  1. A.An address generated by the CPU logic
  2. B.A virtual address used by programs
  3. C.An IP address on the local network
  4. D.The actual address in memory hardware✓ Correct

Explanation

A physical address is the actual address in the physical memory hardware. It is the address that appears on the memory address bus and is used to access data in RAM.

Report an error in this question

Memory ManagementMedium

Q10. The Translation Lookaside Buffer (TLB) is:

  1. A.A disk cache for swap file contents
  2. B.A fast cache for page table entries✓ Correct
  3. C.A type of random access memory chip
  4. D.A backup copy of the main page table

Explanation

The TLB is a small, fast associative cache that stores recently used page table entries. It reduces the time for address translation by avoiding page table lookups for frequently accessed pages.

Report an error in this question

Memory ManagementHard

Q11. What is a multi-level page table and why is it used?

  1. A.A page table with multiple entries per page
  2. B.Hierarchical structure saving memory for sparse spaces✓ Correct
  3. C.A page table stored entirely on secondary disk
  4. D.A table shared by multiple running processes

Explanation

Multi-level page tables use a hierarchy of page tables (e.g., outer and inner page tables). Only the outer table must be in memory; inner tables are created only for used portions of the address space, saving memory.

Report an error in this question

Memory ManagementEasy

Q12. Logical address is:

  1. A.The network address assigned to a device
  2. B.An address generated by CPU for translation✓ Correct
  3. C.The physical location in hardware memory
  4. D.The address of data on the hard disk drive

Explanation

A logical (virtual) address is generated by the CPU during program execution. It is translated to a physical address by the Memory Management Unit (MMU) before accessing actual memory.

Report an error in this question

Memory ManagementEasy

Q13. Internal fragmentation occurs when:

  1. A.No memory is available to allocate to processes
  2. B.The file system is corrupted and cannot allocate blocks
  3. C.Allocated block is larger than requested, wasting space✓ Correct
  4. D.Free memory is scattered in small pieces across RAM

Explanation

Internal fragmentation occurs when the allocated memory block is larger than what was requested (e.g., due to fixed-size allocation units), wasting the difference.

Report an error in this question

Memory ManagementMedium

Q14. Segmentation divides a program into:

  1. A.Equal-sized partitions of memory
  2. B.Fixed-size pages of equal length
  3. C.Variable-size segments like code and data✓ Correct
  4. D.Random blocks of varying sizes

Explanation

Segmentation divides a program into logical units (segments) of variable sizes, such as main program, functions, data structures, stack, and library functions, reflecting the program's logical structure.

Report an error in this question

Memory ManagementEasy

Q15. External fragmentation occurs when:

  1. A.The disk is completely full and cannot store data
  2. B.The allocated pages are much too large for use
  3. C.Internal memory within blocks is wasted by padding
  4. D.Free memory is scattered, cannot satisfy requests✓ Correct

Explanation

External fragmentation occurs when total free memory is sufficient but it is not contiguous. Small, scattered free blocks exist but none is large enough to satisfy a request.

Report an error in this question

Memory ManagementEasy

Q16. The Memory Management Unit (MMU) is responsible for:

  1. A.Managing I/O device controllers
  2. B.Scheduling processes on the CPU
  3. C.Translating logical to physical addresses✓ Correct
  4. D.Managing the file system on disk

Explanation

The MMU is a hardware component that translates logical (virtual) addresses generated by the CPU to physical addresses in memory at runtime.

Report an error in this question

Memory ManagementMedium

Q17. The LRU (Least Recently Used) page replacement algorithm replaces:

  1. A.The page that was loaded into memory first
  2. B.The page not used for the longest time period✓ Correct
  3. C.The largest page currently loaded in a frame
  4. D.The page with the lowest assigned page number

Explanation

LRU replaces the page that has not been referenced for the longest period of time, based on the assumption that pages used recently will be used again soon (temporal locality).

Report an error in this question

Memory ManagementMedium

Q18. The optimal page replacement algorithm (OPT) replaces:

  1. A.The page unused for longest future time✓ Correct
  2. B.The smallest page currently in a frame
  3. C.The least recently used page in memory
  4. D.The first page that was loaded in memory

Explanation

OPT replaces the page that will not be used for the longest period in the future. It produces the fewest page faults but is not implementable in practice since future references are unknown.

Report an error in this question

Memory ManagementHard

Q19. What is the working set model and how does it relate to thrashing?

  1. A.It is a disk scheduling model for I/O requests
  2. B.It is a CPU scheduling model for processes
  3. C.It models CPU utilization across all processors
  4. D.Defines active pages; fewer frames causes thrashing✓ Correct

Explanation

The working set model estimates the set of pages a process actively uses within a recent time window. If the system cannot allocate enough frames to hold a process's working set, that process will thrash.

Report an error in this question

Memory ManagementEasy

Q20. A page table stores:

  1. A.CPU register contents
  2. B.File names and paths
  3. C.Process priority values
  4. D.Page to frame mappings✓ Correct

Explanation

A page table maps each logical page number to the corresponding physical frame number in memory, enabling the translation of logical addresses to physical addresses.

Report an error in this question

Memory ManagementMedium

Q21. The best-fit memory allocation algorithm:

  1. A.Is the fastest allocation algorithm
  2. B.Allocates the first hole it finds
  3. C.Allocates the largest available hole
  4. D.Searches for the smallest sufficient hole✓ Correct

Explanation

Best-fit searches for the smallest hole that is large enough to satisfy the request. It produces the smallest leftover fragment but requires searching the entire list and can create many small unusable fragments.

Report an error in this question

Memory ManagementEasy

Q22. Main memory (RAM) is:

  1. A.Volatile storage the CPU accesses directly✓ Correct
  2. B.A backup device for storing archives
  3. C.Non-volatile persistent storage on disk
  4. D.A type of secondary storage for backup

Explanation

Main memory (RAM) is volatile storage directly accessible by the CPU. Programs must be loaded from secondary storage into main memory to be executed.

Report an error in this question

Memory ManagementHard

Q23. What is an inverted page table?

  1. A.A page table stored in reverse order
  2. B.One entry per physical frame, reducing overhead✓ Correct
  3. C.A page table stored entirely on the disk drive
  4. D.A table that maps physical to logical addresses

Explanation

An inverted page table has one entry per physical frame (not per virtual page). Each entry contains the process ID and virtual page mapped to that frame. It saves space but makes lookups slower without hashing.

Report an error in this question

Memory ManagementHard

Q24. What is the slab allocator used in Linux kernel memory management?

  1. A.A page replacement algorithm for virtual memory
  2. B.A disk allocation method for file storage
  3. C.A virtual memory technique for address mapping
  4. D.Pre-allocating object caches to reduce overhead✓ Correct

Explanation

The slab allocator creates caches of pre-allocated objects of specific sizes (e.g., PCBs, file descriptors). Objects are allocated from and returned to slabs, minimizing allocation/deallocation overhead and fragmentation.

Report an error in this question

Memory ManagementHard

Q25. What is the buddy system for memory allocation?

  1. A.A system with two separate pools for allocation
  2. B.A system where two processes share memory pool
  3. C.A system for backing up memory to the disk
  4. D.Power-of-2 blocks, splitting and coalescing buddies✓ Correct

Explanation

The buddy system allocates memory in blocks of 2^n. A block is split into two buddies (halves) to satisfy smaller requests. When both buddies are free, they are coalesced back into a larger block.

Report an error in this question

Memory ManagementHard

Q26. What is copy-on-write in the context of virtual memory?

  1. A.Copying all pages to disk during every write
  2. B.Writing data twice to provide data redundancy
  3. C.Sharing pages until a write, then making a copy✓ Correct
  4. D.Copying all pages before any read operation

Explanation

Copy-on-write allows parent and child processes to share the same pages after fork(). When either process modifies a page, the OS creates a private copy of that page, avoiding unnecessary duplication.

Report an error in this question

Memory ManagementHard

Q27. What are huge pages (large pages) and when are they beneficial?

  1. A.Pages that span across multiple physical disk drives
  2. B.Pages assigned the highest priority access level
  3. C.Pages used to store very large files on disk
  4. D.Larger pages reducing TLB misses for big workloads✓ Correct

Explanation

Huge pages use page sizes larger than standard (2MB or 1GB vs 4KB), reducing TLB misses and page table size. They benefit applications with large memory footprints like databases and scientific computing.

Report an error in this question

Memory ManagementHard

Q28. What is the page-fault frequency (PFF) approach to preventing thrashing?

  1. A.Setting a maximum number of page faults allowed
  2. B.Monitoring fault rate and adjusting frame allocation✓ Correct
  3. C.Counting total page faults across all processes
  4. D.Preventing all page faults from occurring ever

Explanation

PFF monitors each process's page-fault rate. If the rate exceeds an upper bound, more frames are allocated. If it falls below a lower bound, frames are removed. This directly controls thrashing.

Report an error in this question

Memory ManagementHard

Q29. What is the second-chance (clock) page replacement algorithm?

  1. A.Modified FIFO checking reference bit, gives second chance✓ Correct
  2. B.An algorithm that always replaces the second loaded page
  3. C.A two-pass algorithm scanning memory blocks twice each
  4. D.A modified version of the FIFO algorithm only

Explanation

The second-chance algorithm enhances FIFO by checking each page's reference bit. If set, the bit is cleared and the page is given another chance. If not set, the page is replaced. It approximates LRU.

Report an error in this question

Memory ManagementHard

Q30. What is memory-mapped I/O?

  1. A.Mapping device registers into address space✓ Correct
  2. B.A technique for allocating memory to tasks
  3. C.An I/O scheduling algorithm for requests
  4. D.Storing I/O data in regular memory buffers

Explanation

Memory-mapped I/O maps device registers or files into the virtual address space. Programs access them using standard load/store instructions instead of special I/O instructions, simplifying programming.

Report an error in this question

Ready to test yourself on Memory Management?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Memory Management Quiz