0% found this document useful (0 votes)
9 views2 pages

Paging and Segmentation in OS

The document outlines key concepts of memory management in operating systems, focusing on paging, segmentation, and virtual memory. It explains how paging allows noncontiguous memory allocation and how segmentation divides memory into variable-sized segments. Additionally, it discusses virtual memory's use of disk space for memory illusion, demand paging, and various page replacement algorithms including FIFO, LRU, and Optimal.

Uploaded by

23wh1a0525
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Paging and Segmentation in OS

The document outlines key concepts of memory management in operating systems, focusing on paging, segmentation, and virtual memory. It explains how paging allows noncontiguous memory allocation and how segmentation divides memory into variable-sized segments. Additionally, it discusses virtual memory's use of disk space for memory illusion, demand paging, and various page replacement algorithms including FIFO, LRU, and Optimal.

Uploaded by

23wh1a0525
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Operating System Notes - Paging, Segmentation & Virtual Memory

1. Paging

Paging is a memory management scheme that allows the physical address space of a process to be
noncontiguous. It eliminates the need for contiguous allocation.

Logical Address is divided into: Page Number (p) and Offset (d)
Physical Address = Frame Number + Offset
The page number indexes a page table that contains the base address of each page.

2. Segmentation

Segmentation divides the memory into variable-sized segments based on logical divisions like functions,
arrays, etc.
Each segment has a segment number and an offset.
Segment Table stores: Base Address and Limit for each segment.

Segment Base Address Limit

0 1000 400

1 2000 600

3. Virtual Memory & Demand Paging

Virtual Memory gives the illusion of a large memory by using disk space. Demand Paging loads pages into
memory only when required.

If the page is not present, a Page Fault occurs and the page is loaded from disk.

4. Page Replacement

When no free frame is available, an existing page is replaced. This is handled by Page Replacement
Algorithms:

1. FIFO (First-In-First-Out): Replaces the oldest page.


2. LRU (Least Recently Used): Replaces the page that was least recently used.
3. Optimal: Replaces the page not used for the longest future duration (theoretical best).
Operating System Notes - Paging, Segmentation & Virtual Memory

Algorithm Type Complexity Performance Usage

FIFO Simple O(1) Poor Simulations

LRU Practical O(n)/O(1) Good Real-time OS

Optimal Theoretical High Best Analysis

You might also like