What is swap space on a disk used for?

2005

What is swap space on a disk used for?

Answer: B. Storing process dataConceptVirtual memory allows an operating system to use secondary storage as a backing store for memory pages that are not currently kept in physical RAM.…

  1. A.

    Storing temporary HTML pages

  2. B.

    Storing process data

  3. C.

    Storing the filesystem superblock

  4. D.

    Storing device drivers

Attempted by 202 students.

Show answer & explanation

Correct answer: B

Concept

Virtual memory allows an operating system to use secondary storage as a backing store for memory pages that are not currently kept in physical RAM. Swap space is the disk area reserved for those displaced pages; it extends memory backing but is much slower than RAM.

Application

Here, “process data” means memory pages belonging to processes. When memory pressure rises, the operating system may write selected pages from RAM to swap and later read them back. Therefore, the matching value is “Storing process data.”

Contrast

  • Temporary HTML pages are browser-cache or temporary-directory files, not virtual-memory pages.

  • A filesystem superblock records filesystem metadata rather than process-memory pages.

  • Device drivers are kernel components or modules loaded to control hardware rather than a purpose for reserving swap space.

Cross-check

Moving process pages to disk can release physical frames for active work, which is exactly the role of swap. Storing web cache, filesystem metadata, or driver files would not perform that paging function.

Result: swap space is used for storing process data pages that are moved out of RAM.

Explore the full course: Computer Architecture

Loading lesson…