DEV Community

Cover image for 🧠 What are Pages (in OS/memory)?
Sajidur Rahman Shajib
Sajidur Rahman Shajib

Posted on

🧠 What are Pages (in OS/memory)?

A page is a fixed-length block of virtual memory. When discussing threads, processes, and system memory, paging is a memory management scheme that eliminates the need for contiguous memory allocation.

πŸ”Ή Key Points:

  • Size: Typically 4 KB (can be 2 MB or more in modern systems).
  • Virtual Memory: Programs access memory using virtual addresses, which the OS maps to physical memory using pages.
  • Page Table: Maintains the mapping between virtual pages and physical frames.
  • Swapping: When RAM is full, the OS can move pages to disk (swap space), making room for active data.
  • Benefits: Prevents fragmentation and allows efficient use of memory.

*** πŸ“¦ Real-world analogy:
Think of memory as a book (RAM) and each page in the book is… a page. Programs don't care which physical page they're using; they just read "Page 5", and the OS finds the right actual page in the book.

If you meant something else by β€œpages” (e.g., web pages), let me know. But in this HLD/fundamentals context, it's almost certainly memory pages

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.