Skip to content
Search

Paging

lastmod 2025-11-12created 2016-04-0712 edits

Paging is a technique that organizes and operates virtual memory (Virtual memory) in blocks that are all the same size. Each of these fixed-size blocks is called a page. The address space is divided into pages, and the real memory space is divided into frames the same size as a page.

In a system that uses paging, a virtual address can be expressed as the ordered pair (p, d). p is the number of the page in virtual memory that contains the item to be referenced, and d is the displacement of where the item to be referenced is located within page p.

If the page a process is currently referencing is in main memory, the process can run. Otherwise, the page is read from secondary storage and stored in one block of the page frames.

Performance Tuning

  • Reduce TLB misses with Huge pages (2MB/1GB)

C API

In C programming, the default PAGE size assigned by the OS can be obtained as follows.

Portable applications should employ sysconf(_SC_PAGESIZE) instead of getpagesize():

#include <unistd.h>
long sz = sysconf (_SC_PAGESIZE);

See also

Favorite site

author Zer0 sitemap