api: YAML JSON TOON Database
version: 1.0.0
format: yaml
dataset:
  id: 2847
  slug: memory-management
  title: Memory Management
  description: Techniques for allocating and protecting memory.
  summary: "The core ideas of operating-system memory management: paging and segmentation, virtual memory and page faults, and the mechanisms that make them fast or slow, including page tables, the TLB, replacement policies, copy-on-write and fragmentation."
  use_when:
    - You are explaining how a process gets its address space or why a program slows down under memory pressure.
    - You need the difference between internal and external fragmentation.
  caveats:
    - Terminology varies slightly across systems (swap space versus page file) while the concepts are the same.
    - Numbers such as page size depend on the hardware; common values are 4 KiB with larger huge pages.
  related:
    - process-management
    - file-systems
    - deadlock-handling
  entry_count: 17
  fields:
    - section: data
      field: term
      type: string
      example: Paging
    - section: data
      field: description
      type: string
      example: Divide physical memory into fixed-size frames a…
  category: Operating Systems
  category_slug: operating-systems
  tags: os,memory,paging,virtual-memory
  view_count: 49
  created_at: 1793403093
  updated_at: 1793403093
data:
  - term: Paging
    description: Divide physical memory into fixed-size frames and logical memory into pages.
  - term: Segmentation
    description: Divide memory into variable-sized segments based on logical units.
  - term: Virtual Memory
    description: Abstraction giving each process a large, isolated address space.
  - term: Page Fault
    description: Interrupt raised when a process accesses a page not in physical memory.
  - term: Thrashing
    description: Excessive paging caused by insufficient physical memory.
  - term: Swapping
    description: Moving entire processes between main memory and disk.
  - term: Memory Management Unit
    description: Hardware translating virtual addresses to physical addresses.
  - term: Page Table
    description: A per-process data structure mapping virtual pages to physical frames.
  - term: Translation Lookaside Buffer
    description: A small hardware cache of recent virtual-to-physical translations that avoids walking the page table on every access.
  - term: Demand Paging
    description: Loading a page into memory only when it is first accessed.
  - term: Page Replacement
    description: Choosing which page to evict when memory is full; policies include FIFO, LRU and clock approximations.
  - term: Copy-on-Write
    description: Sharing pages between processes until one writes, then copying only that page, which makes fork cheap.
  - term: Memory-Mapped File
    description: Mapping a file into the address space so it is accessed like memory, with the OS handling the I/O.
  - term: Internal Fragmentation
    description: Wasted space inside an allocated block that is larger than needed.
  - term: External Fragmentation
    description: Free memory split into pieces too small to satisfy a request even though the total would suffice.
  - term: Working Set
    description: The set of pages a process actively uses over a window of time; keeping it in memory avoids thrashing.
  - term: Kernel Space and User Space
    description: Memory regions that separate privileged kernel code from unprivileged programs, enforced by hardware protection.
