###### tags: `operating system` `note` `thu` # Chapter 6. Memory management ## 1. Virtual Memory - Paging, 就是把Memory上對應的page對應到系統的page table上。 - 每一個Process有自己的page table, page table就是取了記憶體中的一塊區域。 - PCB上包含了page table的起始位置。 ## 2. Paging Strategy ### a. Contiguous allocation - Best fit - First fit - Worst fit - 其中又有分Internal/External Fragmentation ## 3. 資料的分放 - 見Figure 9.10 ## 4. Buffer - Translation Lookaside Buffer (TLB) - Content Addressable Memory (CAM) ## 5. Page Replacement Algorithm - https://www.scaler.com/topics/operating-system/page-replacement-algorithm/ ### a. FIFO (First In First Out) ### b. FILO (First In Last Out, stack) ### c. Optimal Page Replacement ### d. LRU(Least Recently Used) ### e. LFU(Least Frequently Used) ### f. MFU(Most Frequently Used) ## Page Fault - Thrashing: 重複發生page fault