Excessive Page Faults Generated By Windows Applications May Impact the Performance of Virtual Machines
search cancel

Excessive Page Faults Generated By Windows Applications May Impact the Performance of Virtual Machines

book

Article ID: 326235

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor VMware vSphere ESXi

Issue/Introduction

My application generates a large number of page faults. I'm seeing poor performance when I run this application inside the virtual machine. What is wrong?
63882

Resolution

Page faults are generated when an application tries to use memory that is part of its working set, but can't find it. Page faults can be either hard or soft:
  • Hard page faults occur when the page is found in the page file on the hard disk.
  • Soft page faults happen when the page is found somewhere else in memory.
Hard page faults involve disk I/O and impact performance. Soft page faults also impact performance, but may not result in heavy performance loss in a physical environment. VMware software does not cause the guest operating system running in the virtual machine to see additional page faults, but VMware software must virtualize the page faults that originate from within the virtual machine. Both soft and hard page faults in a virtual machine cause a context switch into the virtualization layer and some additional processing to virtualize memory management data structures. As on native hardware, hard page faults in a virtual machine also require disk I/O to the page file. For best performance, avoid page faults whenever possible. You can investigate if your Windows application is generating page faults by using the Performance Monitor console (perfmon), which shows you the cumulative number of page faults on the system. Generally, if the rate of paging is slow, then the application is generating hard page faults. You can investigate the paging rate by monitoring the "page faults per second" counter. To invoke perfmon in the Windows guest:
  1. From the Start menu, click Run.
  2. Type perfmon in the text box.
When the Performance Monitor console appears:
  1. Click the + (add counter) button.
  2. In the Add Counters dialog box:
    1. Choose Memory from the Performance object drop-down list.
    2. If it is not already selected, click the Select counters from list radio button.
    3. Choose the Page Faults/sec counter from the list box.
The Performance Monitor console now graphs the number of page faults per second for the whole system. The Pages/sec counter is also useful for finding hard page fault issues because it shows the rate at which pages are read from or written to disk. You can also use perfmon to view per-process page faults. In the Add Counters dialog box:
  1. Choose Process from the Performance object drop-down list.
  2. If it is not already selected, click the Select counters from list radio button.
  3. Choose the Page Faults/sec counter from the list box.
  4. Under Select instances from list, choose the processes of interest from the list box.
Additionally, Microsoft provides a tool in its Windows Resource Kit called Page Fault Monitor (pfmon). Page Fault Monitor allows you to find which system calls in the application are generating page faults. If your application generates page faults, you should:
  1. Determine if the page fault is soft or hard (you can use pfmon for this purpose).
  2. Increase the amount of memory allocated to the application's working set. Some applications, like SQL, allow you to change the working set memory in the configuration.
  3. Increase the memory allocated to the virtual machine.
  4. Contact the application vendor to find out if you can prevent the page faults by tuning or modifying the application settings.
If you have an application that generates a large number of page faults, and if your application vendor is interested in working with VMware, please open a support ticket with VMware. Provide complete information about the application and the steps to reproduce the problem. For discussions related to this topic, see the VMware Community Discussion Forums.

Additional Information

For translated versions of this article, see: