Brain Dump

Page Fault

Tags
comp-arch

Is a hardware signal that may be triggered when a process accesses an address in a frame that's missing in memory. These can be categorised into:

  • Minor: If there is no mapping yet for the page, but it is a valid address. Such as when sbreak is called to enlarge the available heap memory, but the kernel hasn't allocated that space yet.
  • Major: If the mapping to the page is exclusively on disk. The operating system will swap the page into memory and swap another page out. If this happens frequently enough, your program is said to thrash the MMU.
  • Invalid: When a program tries to write to a non-writable memory address or read to a non-readable memory address. This generally leads to a SIGSEGV.