What is swapping in operating systems?

What is swapping in operating systems?

Answer: A. The process of moving pages in and out of memoryConceptVirtual-memory systems use backing storage when physical memory is insufficient. A page-out moves an inactive page from physical memory to backing…

  1. A.

    The process of moving pages in and out of memory

  2. B.

    The process of moving pages only into memory

  3. C.

    The process of moving pages only out of memory

  4. D.

    The process of moving processes in and out of the CPU

Attempted by 415 students.

Show answer & explanation

Correct answer: A

Concept

Virtual-memory systems use backing storage when physical memory is insufficient. A page-out moves an inactive page from physical memory to backing storage, and a page-in restores it to physical memory.

Modern operating-system documentation commonly calls these paired operations swapping out and swapping in. Some classical textbooks use swapping more narrowly for transferring a whole process image, so the terminology should be interpreted in the context of the offered choices.

Application

The description that combines moving pages out of physical memory and bringing them back in captures both directions of the page-transfer mechanism. It is therefore the best-supported description among the supplied choices.

Contrast

  • Moving pages only into memory names page-in, which is one direction of the mechanism.

  • Moving pages only out of memory names page-out, which is the opposite single direction.

  • Moving processes in and out of the CPU describes dispatch or context switching, which is a scheduling operation rather than a transfer between physical memory and backing storage.

Cross-check

The accepted description accounts for both storage-to-memory and memory-to-storage movement, while each one-direction choice omits half of that cycle and the CPU choice addresses a different subsystem.

Result

Swapping, in the modern page-level usage intended by these choices, is the process of moving pages in and out of memory.

Explore the full course: Operating System

Loading lesson…