0% found this document useful (0 votes)
2 views

OS_concepts

The document discusses demand paging, a memory management scheme in modern operating systems that loads program pages into physical memory only when needed. Key features include lazy loading, page faults, and efficient memory use, allowing large programs to run on systems with limited memory. The technique involves handling page faults by loading required pages from disk into memory as they are accessed.

Uploaded by

Ananya Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

OS_concepts

The document discusses demand paging, a memory management scheme in modern operating systems that loads program pages into physical memory only when needed. Key features include lazy loading, page faults, and efficient memory use, allowing large programs to run on systems with limited memory. The technique involves handling page faults by loading required pages from disk into memory as they are accessed.

Uploaded by

Ananya Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

ELL 887 - CLOUD COMPUTING

OS concepts

Acknowledgement: Mythili Vutukuru, IIT Bombay


2
3
4

EIP (Extended Instruction Pointer) is a register in x86 architectures (32bit). Store the
memory address of the next instruction to be executed in a program
5
6
7
8
9
10
11
12
13
14

Demand Paging
 Demand paging is a memory management scheme used in modern
operating systems where pages of a program's memory are loaded
into physical memory only when they are needed, rather than loading
the entire program into memory at once.
 This technique is fundamental to virtual memory systems
• Balancing memory use and performance
 Example Scenario:
• Imagine a program with 100 pages, but only 10 pages fit in memory:
• Without demand paging: The entire 100 pages would need to load,
potentially leading to memory issues or delays.
• With demand paging: Only the 10 pages actually being accessed are
loaded, allowing efficient execution.
15

Demand Paging – Key Features


 Lazy Loading:
• Pages are not loaded into physical memory until a process attempts to access
them.
• This reduces the initial memory footprint of a program.
 Page Faults:
• If a program attempts to access a page not currently in physical memory, a
page fault occurs.
• The operating system handles the fault by locating the required page on disk
and loading it into memory.
 Backing Store:
• Pages not in memory are stored on a backing store, typically a portion of the
disk called the swap space or page file.
 Efficient Memory Use:
 Only the most frequently accessed pages remain in physical memory, while
less-used pages can be swapped out to disk.
 This enables running large programs on systems with limited physical
memory.
16

Demand Paging – Technique


I. A process starts execution with only a small portion of its pages in
memory.
II. When the process accesses a page that is not in memory:
 A page fault exception is triggered.
 The OS:
i. Identifies the required page.
ii. Locates it on disk.
iii. Loads it into a free memory frame.
III. The program continues execution as if the page had always been in
memory.
17
18
19
20
21
22
23
24
25
26
27
28

You might also like