SlideShare une entreprise Scribd logo
1  sur  62
Chapter 9:  หน่วยความจำเสมือน Virtual Memory ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Background ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Virtual Memory That is Larger Than Physical Memory หน่วยความจำเสมือนที่มีขนาดใหญ่กว่าหน่วยความจำทางกายภาพ
Demand Paging ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transfer of a Paged Memory to Contiguous Disk Space การโอนย้ายหน่วยความจำที่ถูกจัดเพจ ไปไว้ยังพื้นที่ต่อเนื่องบนดิสก์
Valid-Invalid Bit ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],1 1 1 1 0 0 0  Frame # valid-invalid bit page table
Page Table When Some Pages Are Not in Main Memory ตารางเพจ ในขณะที่บางเพจไม่อยู่ในหน่วยความจำหลัก
เพจผิดพลาด  Page Fault ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ขั้นตอนในการจัดการเพจผิด  Steps in Handling a Page Fault
ขั้นตอนในการจัดการเพจผิด  Steps in Handling a Page Fault 1.  ตรวจดูตารางข้อมูลการควบคุมโปรเซส  ( PCB)  ที่อ้างอิงถึงเพจที่ต้องการถูกต้องหรือไม่  2.  หากการอ้างอิงผิดพลาดให้ยกเลิก โปรเซส หากการอ้างอิงถูกต้อง แต่เพจที่ต้องการไม่มีอยู่ในหน่วยความจำหลัก ให้ไปดำเนินการขั้นต่อไป  3.  หาพื้นที่ว่างในเฟรม  1  เพจ โดยอาจเลือกจากรายการแสดงแฟรมว่าง  4.  ส่งรีเควสต์ไปยังฮาร์ดดิสก์ เพื่อให้ฮาร์ดดิสก์ทำการอ่านเพจที่ต้องการส่งมาไว้ยังพื้นที่ว่างในเฟรมที่เลือกไว้ก่อนหน้า 5.  เมื่อดิสก์โหลดเพจเสร็จสิ้นแล้ว ระบบจะทำการแก้ไขบิตสถานะในตารางเพจ เป็น “สามารถใช้งานได้”  6.  ให้โปรเซสทำงานต่อจากจุดที่เกิด “การอ้างอิงถึงเพจผิดพลาด หรือ  Page Fault ”  โปรเซสก็จะสามารถทำงานต่อไปเสมือนหนึ่งว่า เพจที่ต้องการใช้งานมีอยู่ในหน่วยความจำตลอดเวลา
กรณีไม่มีเฟรมว่างจะเกิดอะไรขึ้น   What happens if there is no free frame? ,[object Object],[object Object],[object Object],[object Object]
ประสิทธิภาพของการจัดเพจตามความต้องการที่เกิดขึ้น Performance of Demand Paging ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ตัวอย่างการจัดเพจตามความต้องการ Demand Paging Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
การสร้างโปรเซส Process Creation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
COW  ยอมให้ทั้งโปรเซสต้นกำเนิดและโปรเซสลูก สามารถใช้เพจร่วมกันในหน่วยความจำ  หาก ทั้งสองโปรเซสเปลี่ยนแปลงเพจที่ใช้งานร่วมกัน ก็เพียงทำการสำเนาเพจนั้นไว้ก่อน COW  ยอมให้การสร้างโปรเซสหลายโปรเซสได้อย่างมีประสิทธิภาพ โดยเพียงแต่แก้ไขเพจที่ถูกสำเนา เพจว่างถูกจัดสรรให้จาก พูลของเพจที่ไม่ได้ถูกใช้งาน Copy-on-Write
Memory-Mapped Files ,[object Object],[object Object],[object Object],[object Object]
Memory Mapped Files
Page Replacement ,[object Object],[object Object]
Page Replacement ,[object Object],[object Object]
Page Replacement ,[object Object]
Page Replacement ,[object Object]
Need For Page Replacement
Basic Page Replacement ,[object Object],[object Object],[object Object],[object Object]
Page Replacement
Page Replacement Algorithms ,[object Object],[object Object],[object Object],[object Object],[object Object]
Graph of Page Faults Versus The Number of Frames
First-In-First-Out (FIFO) Algorithm   อัลกอริธึมแบบ มาก่อนออกก่อน  ,[object Object],[object Object],[object Object],[object Object],[object Object],1 2 3 1 2 3 4 1 2 5 3 4 9 page faults 1 2 3 1 2 3 5 1 2 4 5 10 page faults 4 4 3
FIFO Page Replacement (First-In-First-Out Algorithm: FIFO) เป็นวิธีการจัดการที่ง่ายที่สุด  เลือกเพจที่มีอายุอยู่ในหน่วยความจำหลักมากที่สุด เป็นเพจที่จะต้องออกไปก่อน แต่ด้วยวิธีนี้เพจที่เก็บค่าสำคัญเพื่อการทำงานหลักของระบบอาจเป็นเพจที่ถูกเลือกให้เป็นเพจที่ต้องออกจากหน่วยความจำ และเมื่อเกิดการอ้างอิงถึงเพจนั้นก็จะต้องทำการโหลดเข้ามาใหม่ หากเพจนั้นถูกอ้างอิงถึงบ่อย จะทำให้เกิดความผิดพลาดในการจัดเพจ ขึ้นบ่อยไปด้วยแม้ว่าจะสามารถโหลดเพจนั้นกลับเข้ามาใหม่ก็ตามแต่ก็จะเกิดความสูญเสียเวลาและงานขึ้น ทำให้ประสิทธิภาพของระบบลดลง  ปรากฏการณ์เช่นนี้เรียกว่า ความผิดปกติ แบบเบลาดี้
FIFO Illustrating Belady’s Anomaly
Optimal Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],1 2 3 4 6 page faults 4 5
Optimal Page Replacement ,[object Object],[object Object],[object Object],[object Object]
Least Recently Used (LRU) Algorithm ,[object Object],[object Object],[object Object],[object Object],1 2 3 5 4 4 3 5
LRU Page Replacement ,[object Object],[object Object]
LRU Algorithm (Cont.) LRU  เป็นวิธีที่ให้ผลทางประสิทธิภาพใกล้เคียงกับแบบประสิทธิภาพดี มากที่สุดโดยมีแนวคิดในการจัดการคือ เมื่อเกิดความต้องการที่จะต้องสลับเพจหนึ่งเพจใดออกจากหน่วยความจำหลัก ระบบจะเลือกเพจที่เคยถูกใช้เป็นครั้งสุดท้ายที่มีระยะเวลานานที่สุด หรืออีกนัยหนึ่งคือเพจนั้นเคยถูกใช้งานล่าสุดมานานกว่าเพจใดๆ ในระบบ จึงคาดว่าระบบนั้นอาจจะไม่ถูกใช้งานหรืออีกนานกว่าจะถูกใช้งาน หรือมีความถี่ที่ถูกอ้างอิงถึงน้อยที่สุดนั่นเอง ระบบก็จะเลือกนำเพจนี้ออกไปจากหน่วยความจำหลักก่อนเพื่อเปิดโอกาสให้เกิดเฟรมว่างขึ้นในหน่วยความจำหลักและสามารถให้เพจที่เกิดขึ้นใหม่และจำเป็นต้องเข้าใช้หน่วยความจำหลักสามารถทำงานได้  ระบบจะทำการบันทึกเวลาที่แต่ละเพจถูกอ้างอิงถึง ครั้งล่าสุดไว้ เมื่อต้องการเลือกเพจใดให้ออกจากหน่วยความจำ ก็จะเลือกจากเพจที่ไม่ถูกอ้างอิงหรือใช้งานเป็นระยะเวลานานที่สุด
Use Of A Stack to Record The Most Recent Page References การใช้แสต็กในการจัดการกับ อ้างอิงถึงเพจเพื่อให้เพจที่ถูกอ้างอิงถึงล่าสุดอยู่บนสุด
LRU Approximation Algorithms  อัลกอริธึมเลียนแบบ  LRU  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Second-Chance (clock) Page-Replacement Algorithm
Counting Algorithms   อัลกอริธึมการนับ  ,[object Object],[object Object],[object Object]
Allocation of Frames ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Fixed Allocation ,[object Object],[object Object]
Priority Allocation ,[object Object],[object Object],[object Object],[object Object]
Global vs. Local Allocation ,[object Object],[object Object]
Thrashing ,[object Object],[object Object],[object Object],[object Object],[object Object]
Thrashing  ,[object Object],[object Object],[object Object],[object Object]
Locality In A Memory-Reference Pattern
Working-Set Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Working-set model
Keeping Track of the Working Set ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Page-Fault Frequency Scheme ,[object Object],[object Object],[object Object]
Other Considerations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other Considerations (Cont.) ,[object Object],[object Object],[object Object]
Increasing the Size of the TLB ,[object Object],[object Object]
Other Considerations (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Other Considerations (Cont.) ,[object Object],[object Object]
Reason Why Frames Used For I/O Must Be In Memory
Demand Segmentation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Operating System Examples ,[object Object],[object Object]
Windows NT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Solaris 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Solaris 2 Page Scanner
Fig 10.03
Fig. 10.2

Contenu connexe

Tendances

Operating System Chapter 2
Operating System Chapter 2Operating System Chapter 2
Operating System Chapter 2Nuth Otanasap
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System InterfaceWayne Jones Jnr
 
ABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type GroupABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type Groupsapdocs. info
 
1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ
1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ
1 ระบบคอมพิวเตอร์และระบบปฏิบัติการkanlayarat
 
Operating System Chapter 1
Operating System Chapter 1Operating System Chapter 1
Operating System Chapter 1Nuth Otanasap
 
Memory Management in Windows 7
Memory Management in Windows 7Memory Management in Windows 7
Memory Management in Windows 7Naveed Qadri
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managmentSantu Kumar
 
Chapter5 the memory-system-jntuworld
Chapter5 the memory-system-jntuworldChapter5 the memory-system-jntuworld
Chapter5 the memory-system-jntuworldPraveen Kumar
 
ระบบจองห้องประชุมออนไลน์
ระบบจองห้องประชุมออนไลน์ระบบจองห้องประชุมออนไลน์
ระบบจองห้องประชุมออนไลน์Preepram Laedvilai
 
องค์ประกอบของคอมพิวเตอร์
องค์ประกอบของคอมพิวเตอร์องค์ประกอบของคอมพิวเตอร์
องค์ประกอบของคอมพิวเตอร์moemon12
 
HR Security in SAP: Securing Data Beyond HCM Authorizations
HR Security in SAP: Securing Data Beyond HCM AuthorizationsHR Security in SAP: Securing Data Beyond HCM Authorizations
HR Security in SAP: Securing Data Beyond HCM AuthorizationsUL Transaction Security
 
แผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้น
แผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้นแผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้น
แผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้นssuser741b9d
 
คู่มือการใช้งาน Libre office
คู่มือการใช้งาน  Libre officeคู่มือการใช้งาน  Libre office
คู่มือการใช้งาน Libre officeพัน พัน
 
basics of virtual memory
basics of virtual memorybasics of virtual memory
basics of virtual memoryAdarsh Patel
 
ditributed databases
ditributed databasesditributed databases
ditributed databasesHira Awan
 
Authorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.infoAuthorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.infosapdocs. info
 

Tendances (20)

Operating System Chapter 2
Operating System Chapter 2Operating System Chapter 2
Operating System Chapter 2
 
Archive data in sap
Archive data in sapArchive data in sap
Archive data in sap
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
ABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type GroupABAP Message, Debugging, File Transfer and Type Group
ABAP Message, Debugging, File Transfer and Type Group
 
แผนการสอนการสร้างเว็บเพจ
แผนการสอนการสร้างเว็บเพจแผนการสอนการสร้างเว็บเพจ
แผนการสอนการสร้างเว็บเพจ
 
1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ
1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ
1 ระบบคอมพิวเตอร์และระบบปฏิบัติการ
 
ระบบติดตามรถ
ระบบติดตามรถระบบติดตามรถ
ระบบติดตามรถ
 
Operating System Chapter 1
Operating System Chapter 1Operating System Chapter 1
Operating System Chapter 1
 
Memory Management in Windows 7
Memory Management in Windows 7Memory Management in Windows 7
Memory Management in Windows 7
 
Virtual memory managment
Virtual memory managmentVirtual memory managment
Virtual memory managment
 
Chapter5 the memory-system-jntuworld
Chapter5 the memory-system-jntuworldChapter5 the memory-system-jntuworld
Chapter5 the memory-system-jntuworld
 
ระบบจองห้องประชุมออนไลน์
ระบบจองห้องประชุมออนไลน์ระบบจองห้องประชุมออนไลน์
ระบบจองห้องประชุมออนไลน์
 
องค์ประกอบของคอมพิวเตอร์
องค์ประกอบของคอมพิวเตอร์องค์ประกอบของคอมพิวเตอร์
องค์ประกอบของคอมพิวเตอร์
 
HR Security in SAP: Securing Data Beyond HCM Authorizations
HR Security in SAP: Securing Data Beyond HCM AuthorizationsHR Security in SAP: Securing Data Beyond HCM Authorizations
HR Security in SAP: Securing Data Beyond HCM Authorizations
 
แผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้น
แผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้นแผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้น
แผนการจัดการเรียนรู้ การเขียนโปรแกรมบนอุปกรณ์เคลื่อนที่เบื้องต้น
 
คู่มือการใช้งาน Libre office
คู่มือการใช้งาน  Libre officeคู่มือการใช้งาน  Libre office
คู่มือการใช้งาน Libre office
 
Лекція №7
Лекція №7Лекція №7
Лекція №7
 
basics of virtual memory
basics of virtual memorybasics of virtual memory
basics of virtual memory
 
ditributed databases
ditributed databasesditributed databases
ditributed databases
 
Authorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.infoAuthorisation Concept In SAP | http://sapdocs.info
Authorisation Concept In SAP | http://sapdocs.info
 

En vedette

En vedette (20)

Ch06th
Ch06thCh06th
Ch06th
 
Operating System Chapter 5
Operating System Chapter 5Operating System Chapter 5
Operating System Chapter 5
 
B6
B6B6
B6
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Fallas2008 Desfiles
Fallas2008 DesfilesFallas2008 Desfiles
Fallas2008 Desfiles
 
Drupal nagw
Drupal nagwDrupal nagw
Drupal nagw
 
Infantil
InfantilInfantil
Infantil
 
Rancangan Perniagaan
Rancangan PerniagaanRancangan Perniagaan
Rancangan Perniagaan
 
Mashups
MashupsMashups
Mashups
 
Ec2009 ch05 online advertising
Ec2009 ch05 online advertisingEc2009 ch05 online advertising
Ec2009 ch05 online advertising
 
Sevilla Mi Destino
Sevilla Mi DestinoSevilla Mi Destino
Sevilla Mi Destino
 
Wave accounting-by-wang-ming
Wave accounting-by-wang-mingWave accounting-by-wang-ming
Wave accounting-by-wang-ming
 
Urbanization
UrbanizationUrbanization
Urbanization
 
Cine Gratis
Cine GratisCine Gratis
Cine Gratis
 
my e-learning
my e-learningmy e-learning
my e-learning
 
An Amazing Man Wb
An Amazing Man   WbAn Amazing Man   Wb
An Amazing Man Wb
 
Ptolemy, Copernicus, and the Church
Ptolemy, Copernicus, and the ChurchPtolemy, Copernicus, and the Church
Ptolemy, Copernicus, and the Church
 
Malaysia Boleh
Malaysia BolehMalaysia Boleh
Malaysia Boleh
 
Lesson Plan Two Us Govt. U23
Lesson Plan Two Us Govt. U23Lesson Plan Two Us Govt. U23
Lesson Plan Two Us Govt. U23
 
Open Id
Open IdOpen Id
Open Id
 

Plus de Nuth Otanasap

กองทุนท่าจีน
กองทุนท่าจีนกองทุนท่าจีน
กองทุนท่าจีนNuth Otanasap
 
มาตรฐานผลการเรียนรู้
มาตรฐานผลการเรียนรู้มาตรฐานผลการเรียนรู้
มาตรฐานผลการเรียนรู้Nuth Otanasap
 
Ec2009 ch01 overview of electronic commerce
Ec2009 ch01 overview of electronic commerceEc2009 ch01 overview of electronic commerce
Ec2009 ch01 overview of electronic commerceNuth Otanasap
 
Ec2009 ch14 creating and launching
Ec2009 ch14 creating and launchingEc2009 ch14 creating and launching
Ec2009 ch14 creating and launchingNuth Otanasap
 
Ec2009 ch15 e commerce strategy
Ec2009 ch15 e commerce strategyEc2009 ch15 e commerce strategy
Ec2009 ch15 e commerce strategyNuth Otanasap
 
Ec2009 ch12 legal ethical and social
Ec2009 ch12 legal ethical and socialEc2009 ch12 legal ethical and social
Ec2009 ch12 legal ethical and socialNuth Otanasap
 
Ec2009 ch11 electronic payment systems
Ec2009 ch11 electronic payment systemsEc2009 ch11 electronic payment systems
Ec2009 ch11 electronic payment systemsNuth Otanasap
 

Plus de Nuth Otanasap (20)

กองทุนท่าจีน
กองทุนท่าจีนกองทุนท่าจีน
กองทุนท่าจีน
 
มาตรฐานผลการเรียนรู้
มาตรฐานผลการเรียนรู้มาตรฐานผลการเรียนรู้
มาตรฐานผลการเรียนรู้
 
SA Chapter 14
SA Chapter 14SA Chapter 14
SA Chapter 14
 
SA Chapter 13
SA Chapter 13SA Chapter 13
SA Chapter 13
 
SA Chapter 12
SA Chapter 12SA Chapter 12
SA Chapter 12
 
SA Chapter 11
SA Chapter 11SA Chapter 11
SA Chapter 11
 
SA Chapter 10
SA Chapter 10SA Chapter 10
SA Chapter 10
 
SA Chapter 9
SA Chapter 9SA Chapter 9
SA Chapter 9
 
SA Chapter 8
SA Chapter 8SA Chapter 8
SA Chapter 8
 
SA Chapter 7
SA Chapter 7SA Chapter 7
SA Chapter 7
 
SA Chapter 6
SA Chapter 6SA Chapter 6
SA Chapter 6
 
SA Chapter 5
SA Chapter 5SA Chapter 5
SA Chapter 5
 
SA Chapter 4
SA Chapter 4SA Chapter 4
SA Chapter 4
 
SA Chapter 3
SA Chapter 3SA Chapter 3
SA Chapter 3
 
SA Chapter 2
SA Chapter 2SA Chapter 2
SA Chapter 2
 
Ec2009 ch01 overview of electronic commerce
Ec2009 ch01 overview of electronic commerceEc2009 ch01 overview of electronic commerce
Ec2009 ch01 overview of electronic commerce
 
Ec2009 ch14 creating and launching
Ec2009 ch14 creating and launchingEc2009 ch14 creating and launching
Ec2009 ch14 creating and launching
 
Ec2009 ch15 e commerce strategy
Ec2009 ch15 e commerce strategyEc2009 ch15 e commerce strategy
Ec2009 ch15 e commerce strategy
 
Ec2009 ch12 legal ethical and social
Ec2009 ch12 legal ethical and socialEc2009 ch12 legal ethical and social
Ec2009 ch12 legal ethical and social
 
Ec2009 ch11 electronic payment systems
Ec2009 ch11 electronic payment systemsEc2009 ch11 electronic payment systems
Ec2009 ch11 electronic payment systems
 

Ch10th

  • 1.
  • 2.
  • 3. Virtual Memory That is Larger Than Physical Memory หน่วยความจำเสมือนที่มีขนาดใหญ่กว่าหน่วยความจำทางกายภาพ
  • 4.
  • 5. Transfer of a Paged Memory to Contiguous Disk Space การโอนย้ายหน่วยความจำที่ถูกจัดเพจ ไปไว้ยังพื้นที่ต่อเนื่องบนดิสก์
  • 6.
  • 7. Page Table When Some Pages Are Not in Main Memory ตารางเพจ ในขณะที่บางเพจไม่อยู่ในหน่วยความจำหลัก
  • 8.
  • 10. ขั้นตอนในการจัดการเพจผิด Steps in Handling a Page Fault 1. ตรวจดูตารางข้อมูลการควบคุมโปรเซส ( PCB) ที่อ้างอิงถึงเพจที่ต้องการถูกต้องหรือไม่ 2. หากการอ้างอิงผิดพลาดให้ยกเลิก โปรเซส หากการอ้างอิงถูกต้อง แต่เพจที่ต้องการไม่มีอยู่ในหน่วยความจำหลัก ให้ไปดำเนินการขั้นต่อไป 3. หาพื้นที่ว่างในเฟรม 1 เพจ โดยอาจเลือกจากรายการแสดงแฟรมว่าง 4. ส่งรีเควสต์ไปยังฮาร์ดดิสก์ เพื่อให้ฮาร์ดดิสก์ทำการอ่านเพจที่ต้องการส่งมาไว้ยังพื้นที่ว่างในเฟรมที่เลือกไว้ก่อนหน้า 5. เมื่อดิสก์โหลดเพจเสร็จสิ้นแล้ว ระบบจะทำการแก้ไขบิตสถานะในตารางเพจ เป็น “สามารถใช้งานได้” 6. ให้โปรเซสทำงานต่อจากจุดที่เกิด “การอ้างอิงถึงเพจผิดพลาด หรือ Page Fault ” โปรเซสก็จะสามารถทำงานต่อไปเสมือนหนึ่งว่า เพจที่ต้องการใช้งานมีอยู่ในหน่วยความจำตลอดเวลา
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. COW ยอมให้ทั้งโปรเซสต้นกำเนิดและโปรเซสลูก สามารถใช้เพจร่วมกันในหน่วยความจำ หาก ทั้งสองโปรเซสเปลี่ยนแปลงเพจที่ใช้งานร่วมกัน ก็เพียงทำการสำเนาเพจนั้นไว้ก่อน COW ยอมให้การสร้างโปรเซสหลายโปรเซสได้อย่างมีประสิทธิภาพ โดยเพียงแต่แก้ไขเพจที่ถูกสำเนา เพจว่างถูกจัดสรรให้จาก พูลของเพจที่ไม่ได้ถูกใช้งาน Copy-on-Write
  • 16.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Need For Page Replacement
  • 23.
  • 25.
  • 26. Graph of Page Faults Versus The Number of Frames
  • 27.
  • 28. FIFO Page Replacement (First-In-First-Out Algorithm: FIFO) เป็นวิธีการจัดการที่ง่ายที่สุด เลือกเพจที่มีอายุอยู่ในหน่วยความจำหลักมากที่สุด เป็นเพจที่จะต้องออกไปก่อน แต่ด้วยวิธีนี้เพจที่เก็บค่าสำคัญเพื่อการทำงานหลักของระบบอาจเป็นเพจที่ถูกเลือกให้เป็นเพจที่ต้องออกจากหน่วยความจำ และเมื่อเกิดการอ้างอิงถึงเพจนั้นก็จะต้องทำการโหลดเข้ามาใหม่ หากเพจนั้นถูกอ้างอิงถึงบ่อย จะทำให้เกิดความผิดพลาดในการจัดเพจ ขึ้นบ่อยไปด้วยแม้ว่าจะสามารถโหลดเพจนั้นกลับเข้ามาใหม่ก็ตามแต่ก็จะเกิดความสูญเสียเวลาและงานขึ้น ทำให้ประสิทธิภาพของระบบลดลง ปรากฏการณ์เช่นนี้เรียกว่า ความผิดปกติ แบบเบลาดี้
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. LRU Algorithm (Cont.) LRU เป็นวิธีที่ให้ผลทางประสิทธิภาพใกล้เคียงกับแบบประสิทธิภาพดี มากที่สุดโดยมีแนวคิดในการจัดการคือ เมื่อเกิดความต้องการที่จะต้องสลับเพจหนึ่งเพจใดออกจากหน่วยความจำหลัก ระบบจะเลือกเพจที่เคยถูกใช้เป็นครั้งสุดท้ายที่มีระยะเวลานานที่สุด หรืออีกนัยหนึ่งคือเพจนั้นเคยถูกใช้งานล่าสุดมานานกว่าเพจใดๆ ในระบบ จึงคาดว่าระบบนั้นอาจจะไม่ถูกใช้งานหรืออีกนานกว่าจะถูกใช้งาน หรือมีความถี่ที่ถูกอ้างอิงถึงน้อยที่สุดนั่นเอง ระบบก็จะเลือกนำเพจนี้ออกไปจากหน่วยความจำหลักก่อนเพื่อเปิดโอกาสให้เกิดเฟรมว่างขึ้นในหน่วยความจำหลักและสามารถให้เพจที่เกิดขึ้นใหม่และจำเป็นต้องเข้าใช้หน่วยความจำหลักสามารถทำงานได้ ระบบจะทำการบันทึกเวลาที่แต่ละเพจถูกอ้างอิงถึง ครั้งล่าสุดไว้ เมื่อต้องการเลือกเพจใดให้ออกจากหน่วยความจำ ก็จะเลือกจากเพจที่ไม่ถูกอ้างอิงหรือใช้งานเป็นระยะเวลานานที่สุด
  • 35. Use Of A Stack to Record The Most Recent Page References การใช้แสต็กในการจัดการกับ อ้างอิงถึงเพจเพื่อให้เพจที่ถูกอ้างอิงถึงล่าสุดอยู่บนสุด
  • 36.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Locality In A Memory-Reference Pattern
  • 46.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Reason Why Frames Used For I/O Must Be In Memory
  • 56.
  • 57.
  • 58.
  • 59.
  • 60. Solaris 2 Page Scanner