ScholarGate
Assistent

Memory Management (Operating Systems)

Operating-system memory management allocates physical memory to processes, implements paging and segmentation, chooses which pages to keep resident, and reclaims memory, mediating between programs' demands and limited physical RAM.

Find emne med PaperMindSnartFind papers & topics
Tools & resources
Hent slides
Learn & explore
VideoSnart

Definition

Operating-system memory management is the set of policies and mechanisms by which the OS assigns physical memory to processes, organizes their address spaces through paging or segmentation, and decides which data remains in memory versus on backing store.

Scope

This topic covers the operating system's role in managing main memory: address-space layout, contiguous allocation and fragmentation, paging and segmentation, page-replacement algorithms (FIFO, LRU, clock, optimal), frame allocation, and policies that prevent thrashing. It complements the hardware view of virtual memory, focusing on OS policy. It excludes hardware translation structures (virtual memory and paging) and on-disk file storage (file systems).

Core questions

  • How does the OS allocate physical memory to processes and limit fragmentation?
  • How do paging and segmentation organize an address space?
  • Which page-replacement algorithm best approximates evicting the page least likely to be used soon?
  • How are frames allocated among processes to keep working sets resident and avoid thrashing?

Key concepts

  • address-space layout
  • contiguous allocation and fragmentation
  • paging and segmentation
  • page-replacement algorithms (FIFO, LRU, clock, optimal)
  • frame allocation
  • demand paging
  • thrashing and working set
  • memory reclamation

Key theories

Page-replacement and locality
Because the ideal policy of evicting the page used furthest in the future is unrealizable, practical algorithms (LRU, clock) approximate it using recent-use information; their effectiveness depends on the locality captured by the working-set model.

Mechanisms

The OS tracks free and allocated memory and maps each process's address space, commonly through paging that divides memory into fixed-size frames. On a page fault it brings in the needed page, evicting a resident page chosen by a replacement algorithm such as clock or LRU. It allocates frames among processes to keep their working sets resident; when demand exceeds capacity, working-set and page-fault-frequency policies reduce multiprogramming to prevent thrashing.

Clinical relevance

Effective memory management lets many programs share limited RAM smoothly and is critical to system throughput and responsiveness. Poor replacement or over-commitment causes thrashing and severe slowdowns, while features such as memory overcommit, compression, and copy-on-write underpin the efficiency of modern servers, containers, and virtual machines.

History

Memory management evolved from simple contiguous allocation and overlays to paging and segmentation as virtual memory matured in the 1960s and 1970s. Denning's working-set theory clarified how to allocate frames and avoid thrashing, and replacement algorithms such as the clock approximation became standard in production operating systems.

Key figures

  • Peter J. Denning
  • Abraham Silberschatz
  • Andrew S. Tanenbaum

Related topics

Seminal works

  • silberschatz2018
  • denning1968
  • tanenbaum2014os

Frequently asked questions

What is the difference between paging and segmentation?
Paging divides memory into fixed-size pages and frames, simplifying allocation and eliminating external fragmentation. Segmentation divides an address space into variable-size, logically meaningful segments (such as code, stack, heap). Some systems combine them, paging within segments.
Why can't the operating system always use the optimal page-replacement policy?
The optimal policy evicts the page that will not be used for the longest time, which requires knowing the future. Since the OS cannot know future references, it uses approximations like least-recently-used or the clock algorithm that infer likely future use from recent past use.