💾

Windows Virtual Memory and Paging

Dec 3, 2025

Overview

  • Lecture explains virtual memory and swap (paging) concepts, focusing on Windows implementation.
  • Covers how virtual memory maps addresses, why paging to disk is used, and where Windows stores page files.
  • Includes steps to view and modify Windows paging file settings and a guideline for sizing on Windows 7 (64-bit).

Virtual Memory: Purpose And Behavior

  • Virtual memory maps virtual addresses used by programs to physical RAM addresses.
  • Mapping simplifies programming by isolating programs from others' memory usage.
  • Allows the system to provide the illusion of more memory than physically installed.

Paging And Swap Concept

  • Disk area stores blocks of data called pages when not kept in RAM.
  • When a page is not recently used, it can be evicted: copied from RAM to disk.
  • Frequently accessed pages stay in RAM for speed; infrequently used pages go to disk.
  • Accessing a page on disk is considerably slower than accessing RAM.
  • OS reads paged-out data back into RAM when an application needs it.

Windows Implementation

  • Windows uses the Memory Manager to handle virtual memory and paging.
  • Page files are stored in a hidden file named pagefile.sys on the root partition.
  • Windows typically creates and manages page files automatically.

How To View Or Change Paging File Settings (Windows)

  • Open Control Panel -> System and Security -> System.
  • Click "Advanced system settings" on the left.
  • In the System Properties dialog, go to the Advanced tab.
  • In Performance section, click Settings.
  • In Performance Options, open the Advanced tab.
  • Under Virtual Memory, click Change to view or override defaults.
  • From there you can set paging file size and add paging files on other drives.

Recommended Paging File Sizing

  • Microsoft guideline (example): on 64-bit Windows 7, set minimum paging file size to 1x the amount of installed RAM.
  • If no specific reason exists, let Windows automatically manage paging file size.

Key Terms And Definitions

  • Virtual Memory: OS mechanism mapping virtual addresses to physical memory.
  • Page: A block/unit of memory that can be moved between RAM and disk.
  • Eviction: Process of copying a page from RAM to disk when not recently used.
  • Page File (pagefile.sys): Hidden file on root partition where Windows stores paged-out memory.
  • Memory Manager: Windows component responsible for virtual memory and paging.

Action Items / Next Steps (if studying or configuring)

  • Verify current pagefile settings via System Properties on Windows.
  • Consider leaving paging file management to Windows unless troubleshooting performance.
  • If adjusting, follow Microsoft sizing guidelines for your Windows version and architecture.