Virtual Memory Management.pdf - Google Drive

1 downloads 190 Views 415KB Size Report
No preview available. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Vi
Virtual Memory Management

Virtual Memory Management

Demand Paging

Page Replacement

FIFO Replacement

Other Issues

Thrashing

Frame Allocation

Optimal Replacement Memory Mapped Files

LRU Replacement Buddy System

Second- Chance Replacement

Slab Allocation

Kernel Memory Allocation

Keywords Demand Paging

It is related to Virtual Memory. Memory pages are loaded only when demanded by program in execution.

Page Fault Program tries to access a page in memory that is not available causing Page Fault. Page Replacement

Page Frames are loaded with memory pages, but there is a time when no Frame is available and an existing frame must be replaced with demanded page. It is done using Page Replacement Algorithms. Page Replacement Algorithms are as follows 1. FIFO Replacement - Replace using First In, First Out basis 2. Optimal Replacement – Replace page that will not be used for longest period of time. 3. LRU Replacement – Replace the page that has not been used for longest period of time. I.

Second Change Replacement – A reference bit is associated with the page that is accessed each time. But when the page is not replaced and given a second chance, its bit is set to 0 and next time if it remains zero, the replacement algorithm will replace it.

II.

Enhanced Second Chance Replacement – Use a Reference bit and a Modified bit as an ordered pair and show four states for the Page. (0, 1) – Page not recently used, but modified. (0, 0) – Neither used, nor modified – best page to replace. (1, 0) – Recently used but not modified. (1, 1) – Recently used and modified.

Keywords Thrashing A Process is requesting pages more time than executing is called to be Thrashing. There is too many page faults for active memory pages. To reduce the effect of thrashing, we find the locality model of the process, which is a set of pages used by program and locality changes constantly. Most recently used locality is the Working-set of the process and thus reduces the effect of thrashing. We decided whether a new page is part of working set of not before replacing it.

Frame Allocation Minimum number of Free Frame required per Process and Maximum number of Frames decided by Physical Memory.

Memory Mapped Files File access need system call and access to disk. Instead virtual memory is mapped to a file and so all the I/O to a file is through memory access not system call. Performance increases if system uses this technique.

Buddy System A segment of contagious physical pages are allocated which are power of two to kernel of OS. Why Buddy?  Consider 256 KB segment – divided into 2 buddies – 128 KB x 2.  Consider 128 KB segment- divided into 2 buddies – 64 KB x 2 and so on. All of these are power of 2.