What is the purpose of swapping in an operating system?
a) To move inactive processes out of main memory to free up space
b) To allocate more CPU time to high-priority processes
c) To manage file system permissions
d) To ensure secure communication between processes
Answer:
a) To move inactive processes out of main memory to free up space
Explanation:
Swapping is a memory management technique where inactive or less-used processes are temporarily moved out of main memory (RAM) to secondary storage (such as a hard drive) to free up space for other processes. This allows the system to load and execute more processes concurrently.
When a swapped-out process is needed again, it is brought back into memory, potentially swapping out another process to make room. This ensures that high-demand processes get memory resources without requiring the system to have excessive physical memory.
Swapping is especially useful in environments with limited physical memory, as it increases the effective capacity of the system by using disk space as a temporary memory store.