DEV Community

Cover image for Summary of Memory Management Terms
Kenta Takeuchi
Kenta Takeuchi

Posted on • Originally published at bmf-tech.com

Summary of Memory Management Terms

This article was originally published on bmf-tech.com.

Overview

While reading the memory management chapter of Understanding Linux Internals, I encountered some terms that I didn't fully understand, so I picked a few and summarized them.

OOM

  • Out of memory
  • A state where the system cannot allocate new memory because it has exhausted both physical and virtual memory
  • OOM Killer (Out of Memory Killer)
    • A mechanism in the Linux kernel that forcibly terminates processes to free up memory when OOM occurs

Virtual Memory

  • Memory that the OS virtualizes to appear as main storage
  • Treats scattered addresses on physical memory as sequential addresses
  • A feature that considers part of the hard disk as virtual memory addresses
    • → Swap

Page Table

  • A data structure used in the OS's virtual memory to map virtual addresses to physical addresses

Page Fault

  • An interrupt or exception generated by hardware when a program accesses a page in the virtual address space that is not mapped to physical memory

File Map

  • Mapping a file into memory
    • In C language, this can be done with mmap
    • Similar to performing paging or swapping by the OS within one's own process

Demand Paging

  • A type of memory management
  • A method where physical memory is allocated to a page when the memory content of the corresponding address is needed

Copy-on-Write

  • A mechanism where copying is done at the time of writing
  • When creating a child process from a parent process, it temporarily shares the parent's memory space (with write protection specified) without copying all data in the parent's memory, thus reducing the processing time for process creation
  • When either process issues a write request to the shared memory space, a new memory space is allocated, and the data in memory is copied
  • This is the method

Swap

  • An OS feature that increases memory capacity by securing a storage area called a swap file or swap space on auxiliary storage devices like hard disks
  • Also, in paged virtual memory, swapping or page swapping refers to exchanging pages between physical memory and auxiliary storage

References

Top comments (0)