Memory management - Quiz
  • 1. What is the primary function of slab allocation?
A) Automatically garbage collecting unused heap objects
B) Managing stack pointers for dynamic local variables
C) Preallocating memory chunks for specific object types or sizes
D) Allocating memory exclusively for static global variables
  • 2. What is a cache in the context of slab allocation?
A) A garbage collection pool
B) A temporary stack pointer adjustment
C) A preallocated chunk of memory
D) A POSIX standard memory routine
  • 3. What happens when an object is destructed in slab allocation?
A) The memory fragment is compressed
B) The stack pointer is decremented
C) The memory is immediately returned to the OS
D) The slot is added back to the free list
  • 4. Why is slab allocation considered efficient?
A) It eliminates the need to search for suitable memory portions
B) It never requires free lists
C) It uses hardware acceleration
D) It automatically ignores object types
  • 5. What benefit does slab allocation provide regarding memory?
A) It alleviates memory fragmentation
B) It ensures memory is never overwritten
C) It prevents all types of stack overflows
D) It increases the depth of recursion
  • 6. What is the purpose of alloca?
A) Managing static heap memory
B) Automatic garbage collection
C) Compacting memory fragments
D) Dynamic stack memory allocation
  • 7. What mechanism typically implements alloca?
A) A complex garbage collection routine
B) Inlined instructions manipulating the stack pointer
C) A heap-based allocation library
D) A standard system call managed by the OS kernel
  • 8. When is memory allocated via alloca automatically freed?
A) When the garbage collector runs
B) When the calling function returns
C) When the program reaches the heap limit
D) When the manual free function is called
  • 9. What is a major risk associated with using alloca?
A) Stack overflow
B) Excessive cache misses
C) Memory leakage in the garbage collector
D) Heap fragmentation
  • 10. Is alloca defined in the C standard?
A) Yes
B) No
C) Only in POSIX standards
D) Only in Windows-specific headers
  • 11. What is the safer version of alloca used on Microsoft Windows?
A) stack_malloc
B) alloca_safe
C) _malloca
D) mem_guard
  • 12. What function must be used to free memory allocated by _malloca?
A) release_mem
B) _freea
C) free_stack
D) _free_alloca
  • 13. How does gnulib handle an overlarge size in its alloca equivalent?
A) It throws an SEH exception
B) It crashes the application immediately
C) It ignores the allocation request
D) It delegates to malloc
  • 14. What is an automatic variable?
A) A non-static local variable of a subroutine
B) A variable managed by manual memory allocation
C) A variable stored in the global data segment
D) A heap-allocated object handled by garbage collection
  • 15. Where is memory for automatic variables typically allocated?
A) The call stack
B) The static data segment
C) The register file
D) The heap
  • 16. What makes recursion possible according to the text?
A) The automatic allocation of local variables
B) Garbage collection algorithms
C) The slab allocation mechanism
D) Manual memory management
  • 17. What is a disadvantage of garbage collection?
A) It creates stack overflows
B) It can compete with the application for processor time
C) It requires manual allocation calls
D) It prevents programmers from using recursion
  • 18. What is the primary goal of garbage collection?
A) Allocating memory for local subroutine variables
B) Preallocating chunks for specific object sizes
C) Detecting and reclaiming unusable objects
D) Managing stack pointer arithmetic
  • 19. How does manual memory management differ from garbage collection?
A) It requires the programmer to explicitly release memory
B) It is not used in any modern programming language
C) It automatically detects unusable memory
D) It uses a stack pointer for all operations
  • 20. What does the text suggest about the difficulty of memory management?
A) It is easily solved by hardware
B) It is a difficult problem
C) It is only a problem for assembly programmers
D) It is no longer a relevant concern for software developers
  • 21. Why is memory management critical in multitasking systems?
A) It speeds up network communication
B) It prevents hardware crashes
C) Multiple processes run simultaneously
D) It reduces the need for storage
  • 22. In which type of operating system is memory managed by the OS?
A) Burroughs/Unisys MCP
B) Android
C) Unix-like systems
D) Linux
  • 23. What is used to manage the inflation of small allocations caused by metadata?
A) Caching
B) Paging
C) Chunking
D) Swapping
  • 24. What must a memory management system track to avoid memory leaks?
A) User login attempts
B) The system clock
C) Outstanding allocations
D) Disk partition sizes
  • 25. What was the lowest average instruction path length to allocate a memory slot found in the 1994 DEC study?
A) 64
B) 42
C) 28
D) 52
  • 26. Why is fixed-size blocks allocation often used in video games?
A) It eliminates all fragmentation
B) It handles large objects efficiently
C) It uses less total system memory
D) Reduced overhead improves performance
  • 27. What types of systems are fixed-size blocks allocation best suited for?
A) Simple embedded systems
B) Virtual machine environments
C) Massive supercomputer clusters
D) General purpose operating systems
  • 28. When a block is freed in the buddy system, what is it compared to?
A) The total system pool
B) A list of all free pointers
C) The kernel instruction path
D) Its buddy
  • 29. What occurs if two buddy blocks are both free?
A) They are split into smaller units
B) They are combined
C) They are deleted from memory
D) They are moved to a fixed-size list
  • 30. How does the buddy allocator select the starting block size for a request?
A) A random block
B) The first block in the free list
C) Largest available block
D) Smallest sufficiently large block
  • 31. How can circular references in reference counting be mitigated?
A) By using weak references
B) By increasing the counter manually
C) By using only primary storage
D) By disabling the pointer check
  • 32. What does virtual memory decouple memory organization from?
A) The physical hardware
B) The CPU registers
C) The application's logic
D) The operating system kernel
  • 33. Who or what can implement reference counting automatically?
A) The secondary storage controller
B) The compiler
C) The user
D) The physical hardware
  • 34. What is a weak reference?
A) A reference that cannot be translated to a physical address
B) A reference that does not participate in reference counting
C) A reference that always points to null
D) A reference that is only used in primary storage
  • 35. What does virtual memory use to extend physical memory?
A) Cache memory
B) Extra space on a peripheral device
C) Additional CPU registers
D) The memory management unit
  • 36. What is the process of moving code and data between main and virtual memory called?
A) Overlaying
B) Paging
C) Segmentation
D) Swapping
  • 37. The B5000 system integrated virtual memory starting in what year?
A) 1961
B) 1971
C) 1955
D) 1951
  • 38. What represents the physical portions of memory where logical blocks are mapped?
A) Pages
B) Sectors
C) Segments
D) Clusters
  • 39. What contains the metadata about an allocated memory block?
A) Memory map
B) The overlay register
C) The MCP kernel
D) Segment descriptor
  • 40. Who describes a system similar to the MCP memory management in 'Fundamental Algorithms'?
A) Alan Turing
B) Charles Babbage
C) Donald Knuth
D) Ada Lovelace
  • 41. What is the usual medium used for virtual memory extension?
A) Disk
B) Flash
C) RAM
D) Tape
  • 42. Which macro is used to request storage in OS/360?
A) FREEMAIN
B) ALLOCATE
C) GETMEM
D) GETMAIN
  • 43. What is the size increment for subpools in MVT?
A) 2 KB
B) 1 KB
C) 4 KB
D) 8 KB
  • 44. What is the range of subpool numbers in OS/360 MVT?
A) 250–255
B) 0–255
C) 0–15
D) 1–127
  • 45. Which subpools receive the job's storage protection key?
A) 0–255
B) 0–127
C) 250–255
D) 128–255
  • 46. Which memory management system type has only a single partition?
A) OS/VS2
B) MVT
C) PCP
D) MFT
  • 47. What is the page size in OS/VS2?
A) 2 KB
B) 1 KiB
C) 4 KiB
D) 8 KiB
  • 48. Which storage area is nonpageable in both OS/VS1 and OS/VS2?
A) System Work area (SWA)
B) Common Storage Area (CSA)
C) Local System Queue Area (LSQA)
D) System Queue Area (SQA)
  • 49. In MVS, which storage keys are reserved for privileged code?
A) 8–15
B) 0–15
C) 0–3
D) 0–7
  • 50. What replaces dynamic regions in MFT?
A) Fixed partitions
B) Subpool sets
C) Virtual pages
D) Single partition
  • 51. Which macro is used to free storage in OS/360?
A) RELEASE
B) FREEMAIN
C) DEALLOCATE
D) GETMAIN
  • 52. What determines the upper limit of memory allocation in a job's region?
A) The supervisor key
B) The region size
C) The page size
D) The number of subpools
  • 53. What is the role of the operator in MFT memory management?
A) Redefining partitions
B) Assigning subpools
C) Setting protection keys
D) Managing virtual memory
  • 54. Which MVS area is a pageable shared area?
A) System Queue Area (SQA)
B) System Work area (SWA)
C) Local System Queue Area (LSQA)
D) Common Storage Area (CSA)
Created with That Quiz — where test making and test taking are made easy for math and other subject areas.