Memory Paging and Virtual Address Space Management

Classified in Computers

Written on in English with a size of 3.18 KB

Memory Paging Fundamentals

Paging consists of dividing physical memory into fixed-size sections called frames and logical memory into sections of the same size called pages.

The paging system solved the problem of allocating blocks of equal size using physical memory called page frames.

Page Faults and Replacement

A page fault occurs when referring to a page that is not loaded in any page frame. A page replacement (or page out) is required because the total virtual address space of all processes exceeds the size of physical storage.

Functional Requirements

  • Administration of address space.
  • Address translation.
  • Management of physical memory.
  • Memory protection.
  • Shared memory.
  • Load monitoring system.
  • Mapping files into memory, program execution on remote nodes, dynamic linking to shared libraries, and swap area.
  • Efficient page replacement.

Virtual Address Space Segments

The virtual address space of a process can be divided into different segments (pages):

  • Text (code).
  • Initialized data.
  • Uninitialized data.
  • Modified data.
  • Stack.
  • Heap.
  • Shared memory.
  • Shared libraries.

Page Replacement Policies

These policies determine how the kernel decides to expel a page from physical memory. There are two replacement techniques:

  • Local: The page selected is one of the pages belonging to the specific process.
  • Global: Selected pages can belong to any process.

Working Set and Locality of Reference

The working set is the set of pages that ideally should be maintained in memory; these are the pages that will be needed in the future.

Locality of reference implies that a process tends to concentrate its references in a certain small subset of pages, and this subset changes slowly.

Memory Management Unit (MMU)

The MMU (Memory Management Unit) is the functional unit between the CPU and main memory, often integrated into the microprocessor. The main task of the MMU is to translate virtual addresses to real addresses.

Multilevel Paging

Objectives: To avoid having very large page tables always present in memory.

Solution: Split the table into subtables and keep only the necessary memory in storage at any given time.

Paging Performance and Access Time

The Effective Access Time (EAT) for a single-level memory paging system is calculated as follows:

EAT = ts + (1-p) * tm + p * tfallo

  • ts: Time spent searching through the page table.
  • p: Probability that a page fault occurs.
  • tm: Memory access time.
  • tfallo: Time required for the resolution of a page fault.

The 90/10 Rule: A process typically spends 90% of its time accessing only 10% of its memory.

Related entries: