Memory Management in OS
- 17Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the primary focus of memory management in an operating system?
What is the primary focus of memory management in an operating system?
17 questions
- 1
What is the primary focus of memory management in an operating system?
- A
Managing the input/output devices connected to the system
- B
Managing the CPU registers and cache memory
- C
Managing only the secondary memory to store programs
- D
Managing all types of memory resources efficiently, especially primary memory
Correct answer
DManaging all types of memory resources efficiently, especially primary memory
Explanation
Memory management focuses on efficiently managing various memory resources, with special emphasis on primary memory (RAM) because it directly affects system performance and cost.
- A
- 2
Why is memory management particularly concerned with primary memory (RAM)?
- A
Because RAM stores all programs permanently and needs organization
- B
Because RAM is directly connected to the CPU and its size impacts performance and cost
- C
Because RAM is slower than cache and registers, requiring management for speed
- D
Because RAM is the most expensive memory and requires careful allocation
Correct answer
BBecause RAM is directly connected to the CPU and its size impacts performance and cost
Explanation
RAM is directly connected to the CPU and its size affects both system cost and performance. Increasing RAM size improves multiprogramming but also increases cost, so it must be managed carefully.
- A
- 3
Which of the following memories are directly connected to the CPU?
- A
RAM, registers, and secondary memory
- B
RAM, hard disk, and cache
- C
Registers, cache, and RAM
- D
Registers, cache, and hard disk
Correct answer
CRegisters, cache, and RAM
Explanation
The CPU is directly connected to registers, cache, and RAM (primary memory). Secondary memory like hard disks is not directly connected due to speed differences.
- A
- 4
Why is secondary memory not directly connected to the CPU?
- A
Because secondary memory is too expensive to be connected directly
- B
Because secondary memory is non-volatile and cannot interact with the CPU
- C
Because secondary memory is much slower than the CPU, causing a speed mismatch
- D
Because secondary memory requires a separate controller that the CPU cannot access
Correct answer
CBecause secondary memory is much slower than the CPU, causing a speed mismatch
Explanation
Secondary memory (e.g., hard disk) is significantly slower than the CPU, so a direct connection would create a bottleneck. Faster memories like RAM, cache, and registers are placed in between.
- A
- 5
What is the role of secondary memory in program execution?
- A
It provides high-speed storage for frequently used data
- B
It is where the CPU directly fetches instructions from
- C
It temporarily holds data currently being used by the CPU
- D
It stores all programs and processes that are waiting to be executed
Correct answer
DIt stores all programs and processes that are waiting to be executed
Explanation
Secondary memory (e.g., hard disk) stores all programs. When a program needs to be executed, it is brought into primary memory so the CPU can access it.
- A
- 6
To execute a program stored in secondary memory, where must it be brought first?
- A
Into the cache memory
- B
Into the RAM (primary memory)
- C
Into the secondary memory itself
- D
Into the CPU registers
Correct answer
BInto the RAM (primary memory)
Explanation
Since the CPU is not directly connected to secondary memory, programs must be loaded into RAM first so the CPU can interact with and execute them.
- A
- 7
What is the Degree of Multiprogramming?
- A
The number of processes that can be stored in secondary memory
- B
The number of processes that are loaded into RAM for execution
- C
The percentage of CPU time spent on executing processes
- D
The total number of I/O operations performed by a process
Correct answer
BThe number of processes that are loaded into RAM for execution
Explanation
Degree of Multiprogramming refers to the number of processes residing in RAM (main memory) at a given time. Higher degree means more processes are ready for CPU execution.
- A
- 8
How does increasing the Degree of Multiprogramming affect CPU utilization?
- A
CPU utilization decreases because more processes compete for CPU time
- B
CPU utilization remains the same because processes are executed sequentially
- C
CPU utilization increases because the CPU is less likely to idle while waiting for I/O
- D
CPU utilization increases only if the processes are CPU-bound
Correct answer
CCPU utilization increases because the CPU is less likely to idle while waiting for I/O
Explanation
With more processes in RAM, when one process performs I/O, the CPU can execute another process, reducing idle time and thus increasing CPU utilization.
- A
- 9
In the context of multiprogramming, what does the variable 'K' typically represent in the CPU utilization formula?
- A
The fraction of time a process spends doing I/O operations
- B
The number of processes in the ready queue
- C
The size of the process in megabytes
- D
The number of I/O devices attached to the system
Correct answer
AThe fraction of time a process spends doing I/O operations
Explanation
K represents the fraction of time a single process spends on I/O operations. For example, if a process spends 70% of its time on I/O, then K = 0.7.
- A
- 10
If a process spends 30% of its time on I/O (K = 0.3) and there is only one process in RAM, what is the CPU utilization?
- A
30%
- B
9%
- C
100%
- D
70%
Correct answer
D70%
Explanation
With one process, CPU utilization = 1 - K = 1 - 0.3 = 0.7 = 70%.
- A
- 11
What is the general formula for CPU utilization when n processes are in memory, each spending fraction K on I/O?
- A
1−nK
- B
1−Kn
- C
n(1−K)
- D
1−(1−K)n
Correct answer
B1−Kn
Explanation
CPU utilization = 1 - (probability all processes are doing I/O simultaneously) = 1−Kn.
- A
- 12
If K = 0.7 and n = 4, what is the approximate CPU utilization?
- A
94%
- B
30%
- C
76%
- D
51%
Correct answer
C76%
Explanation
1−0.74=1−0.2401=0.7599≈76%.
- A
- 13
According to the numerical example, what happens to CPU utilization as RAM size is increased while keeping process size constant?
- A
CPU utilization remains the same because the CPU speed is unchanged
- B
CPU utilization decreases because more processes introduce overhead
- C
CPU utilization increases because more processes can be accommodated, reducing idle time
- D
CPU utilization initially increases but then decreases after a certain point
Correct answer
CCPU utilization increases because more processes can be accommodated, reducing idle time
Explanation
Increasing RAM size allows higher degree of multiprogramming, which increases CPU utilization as shown by the formula 1−Kn.
- A
- 14
Which of the following is NOT a responsibility of memory management in an operating system?
- A
Deallocating memory when processes terminate
- B
Ensuring security by preventing processes from interfering with each other's memory
- C
Allocating memory to processes
- D
Scheduling processes on the CPU
Correct answer
DScheduling processes on the CPU
Explanation
Memory management handles allocation, deallocation, and security (protection) of memory. CPU scheduling is a separate function of the operating system.
- A
- 15
Why is security an important concern in memory management?
- A
To prevent users from deleting system files
- B
To protect the operating system from viruses
- C
To prevent processes from reading each other's data by limiting access to allocated memory regions
- D
To ensure that processes cannot be interrupted during execution
Correct answer
CTo prevent processes from reading each other's data by limiting access to allocated memory regions
Explanation
When multiple processes are in memory, one process might accidentally or maliciously access another's memory space. Memory management enforces protection so each process can only access its own allocated region.
- A
- 16
What is a potential drawback of bringing an entire process into RAM as a single block?
- A
It wastes memory if only a small part of the process is needed, and loading the whole block consumes bandwidth
- B
It increases the degree of multiprogramming too much
- C
The process cannot be swapped out once loaded
- D
The process may be too small to execute efficiently
Correct answer
AIt wastes memory if only a small part of the process is needed, and loading the whole block consumes bandwidth
Explanation
Loading an entire process (e.g., 4MB) when only a few bytes are needed is inefficient. It uses memory and bus bandwidth unnecessarily. Paging and segmentation address this by loading only required blocks.
- A
- 17
Which techniques are mentioned as ways to avoid loading entire processes into memory?
- A
Demand paging and virtual memory
- B
Swapping and caching
- C
Fragmentation and compaction
- D
Paging and segmentation
Correct answer
DPaging and segmentation
Explanation
The content specifically mentions paging and segmentation as techniques to divide processes into smaller blocks that can be loaded as needed.
- A

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