130 likes | 242 Views
T111. The Page File. Last Week…. Problem. What if the process or processes request more pages of virtual memory than there are pages of physical RAM? The answer - copy the contents of a page of memory to some other storage device and then let that page of memory be used by a process. Paging.
E N D
T111 The Page File
Problem • What if the process or processes request more pages of virtual memory than there are pages of physical RAM? • The answer - copy the contents of a page of memory to some other storage device and then let that page of memory be used by a process
Paging • When a process needs to access a page of memory: • Accesses the memory page in RAM • OR • The memory page is copied from the page file into RAM and then accessed • Page out – Memory page is moved from RAM to the page file • Page in – Memory page is moved from the page file back into RAM
Virtual address space(per process) Paging Physical RAM Secondary storage Memory Page
Where is the page file? • pagefile.sys • On the C:\ drive by default C:\>dir /ah pagefile.sys Volume in drive C is System_Disk Volume Serial Number is E087-4551 Directory of C:\ 08/09/2007 05:04 p.m. 1,598,029,824 pagefile.sys 1 File(s) 1,598,029,824 bytes 0 Dir(s) 5,069,359,104 bytes free
Working Set • The active pages of virtual memory that a process uses during its execution • Only the active pages of virtual memory associated with a process will remain resident in physical RAM • The non-active pages will eventually be paged-out to secondary storage
Committed Pages • A page of virtual memory that has been addressed by a process • They can either be in physical memory or in the page file • A committed page includes the active pages from the working set and the non-active pages that may have been paged-out to secondary storage
Page Fault • When a process attempts to access a page of memory in RAM but that page is actually in the page file • The page will have to be ‘paged in’ before the process can access it • What will the process do while waiting for the page to be paged in?
Thrashing • If the working sets of the active processes are larger than the physical RAM then thrashing occurs Process A Working Set RAM Process B Working Set
Disk Contention • When two or more processes are trying to access the HDD at the same time • Causes the HDD to jump between areas retrieving data for each process simultaneously • Becomes worse as paging increases • What can be done to help alleviate this?
Paging • Windows makes an effort to improve the response time of a process by always having some free memory • Windows will page-out pages to secondary storage before there is no free RAM available • Windows decides which pages to page-out based on a least-recently-used algorithm
Paging • Paging is a slow process that affect the performance of a computer • What can be done to reduce paging? • What can be done to improve the performance of paging?