Explanation of Page Faults

Posted on 2009-02-21
Medium Priority
Last Modified: 2013-11-10
Can somebody who understands the concept please provide me with an explanation of what a Page Fault is?

I have specifically been told that an application with a high number of page faults is not a bad thing, but what does having a high level actually mean?

Please, no links if you can avoid it. I'd rather even just a few sentences to describe this rather than pages of articles to read.
Question by:tigermatt
LVL 11

Assisted Solution

sysreq2000 earned 800 total points
ID: 23703112
The operating system will regularly "flush out" parts of ram and save it on the hard disk in order to free up ram for use. Usually it's data in ram that the OS has identified as not being accessed often that get flushed out to the hard disk. The data is stored in a "page file" or "swap file" on the hard disk.

When a program needs that data, the operating system loads it back into memory for the program to access. The program requesting a "page" of data in ram that isn't there is known as a page fault. It's a misleading label bacause it's not really a "fault" per se, it's supposed to happen that way by design.

That's not the only scenario by it's by far the most common. In a nutshell, a page fault is a program's attempt to access data in RAM that is not there or is not accessible.

Accepted Solution

-DJL- earned 1200 total points
ID: 23704203
A page is a fixed size block of memory that can be moved between memory and the page file on the hard disk.  x86 Windows uses 4KB pages.  When the OS needs to make space in physical memory, pages that are not likely to be required in the near future are moved to disk.

A page fault occurs when the page an application is requesting is not available in memory.  

There are two types of page fault;

Hard Page Fault - the requested page isn't available in main memory and must be loaded from disk.  These are the most costly performance wise - could be anywhere between 10,000 to 100,000 times slower than if the page had been available.

Soft Page Fault - the requested page isn't currently available to the application, but the page exists in memory.  Soft faults are much faster than hard faults as no disk access is required, all the viriutal memory manager has to do is update page tables to allow the program access to the requested page.  This usually occurs when pages are shared between programs.

Pages faults are never really good, but are a common and necessary event.  When looking at 'Page Fault' figures in windows you need to be aware if the figure includes both soft and hard faults or just one or the other.  Its also important to look at how the page faults are impacting the system, rather than just worrying about the number.

Take the vmware-hostd service.  That always seems to have high numbers of page faults listed in task manager.  Now, the task manager page faults is the sum of both hard and soft faults, however digging deeper, most of the faults are soft.  Presumably the service is sharing some memory with the running VMs in order to manage them. In this case high page faults isn't something to worry about.

If on the other hand you are getting lots of hard page faults and this is causing high disk utilisation then you have a problem - thrashing is the term used to describe the situation where a computer spends all its time swapping pages in and out of memory instead of running the applications.  


Featured Post

Sign your company up to try the MB 660 headset now

Take control and stay focused in noisy open office environments with the MB 660. By reducing background noise, you can revitalize your office and improve concentration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question