Materi kuliah sistem operasi untuk perguruan tinggi
6vgvv7vyh4
6 views
12 slides
Aug 28, 2025
Slide 1 of 12
1
2
3
4
5
6
7
8
9
10
11
12
About This Presentation
sistem operasi
Size: 270.37 KB
Language: en
Added: Aug 28, 2025
Slides: 12 pages
Slide Content
Memory Management
(2)
VIRTUAL MEMORY
•Problem : programs were too big to fit in the available
memory
•Solution :
•1. overlay (split the program into pieces)
•Swapping overlay done by system, however splitting the program
has to done by the programmer
•2. Virtual memory
•Basic idea : programs may exceed the amount of physical
memory available for it
•Most virtual memory system use a technique called paging,
Paging
•Virtual addresses : program-generated
addresses, it form Virtual address space.
•Memory Management Unit (MMU) : maps
the virtual addresses onto the physical
memory addresses
Paging
•Virtual address space is divided up into units called pages
•The corresponding units in the physical memory are called
page frames
•Page fault / fault = happened if program tries to use an
unmapped page.
•The operating system picks a little-used page frame and
writes its contents back to the disk.
•It then fetches the page just referenced into the page frame
just freed, changes the map, and restarts the trapped
instruction.
Paging
Virtual address consist of 2 part :
page number p
offset page d
Page table = table for all processes in the memory
Virtual address 0
mapped to physical
address 20 ((5 x 4) + 0).
Virtual address 5
mapped to physical
address 25 ((6 x 4) +1).
Page Replacement Algorithm
When a page fault occurs, the operating
system has to choose a page to remove from
memory to make room for the page that has to
be brought in.
Objective : Minimum page fault
Page Replacement Algorithm
•Random
•FIFO (First In First Out)
•Optimal
•LRU (Least Recently Used)
FIFO (First In First Out)
Replace the oldest page
Number of faults : 15
Optimal
Replace the page that will not be used in the near future
Impossible to implement because the operating system
has no way of knowing when each of the pages will be
referenced next.
LRU (Least Recently Used)
Replace the page that is not recently used