Virtual Memory Performance Implications

While virtual memory makes it possible for computers to more easily handle larger and more complex applications, as with any powerful tool, it comes at a price. The price in this case is one of performance — a virtual memory operating system has a lot more to do than an operating system that is not capable of virtual memory. This means that performance will never be as good with virtual memory than with the same application that is 100% memory-resident.

However, this is no reason to throw up one's hands and give up. The benefits of virtual memory are too great to do that. And, with a bit of effort, good performance is possible. The thing that must be done is to look at the system resources that are impacted by heavy use of the virtual memory subsystem.

Worst Case Performance Scenario

For a moment, take what you have read in this chapter, and consider what system resources are used by extremely heavy page fault and swapping activity:

The interrelated nature of these loads makes it easy to see how resource shortages can lead to severe performance problems. All it takes is:

At this point, the system will be thrashing, with performance rapidly decreasing.

Best Case Performance Scenario

At best, system performance will present a minimal additional load to a well-configured system:

From this, the overall point to keep in mind is that the performance impact of virtual memory is minimal when it is used as little as possible. This means that the primary determinant of good virtual memory subsystem performance is having enough RAM.

Next in line (but much lower in relative importance) are sufficient disk I/O and CPU capacity. However, these resources only help the system performance degrade more gracefully from have faulting and swapping; they do little to help the virtual memory subsystem performance (although they obviously can play a major role in overall system performance).

Notes

[1]

A reasonably active system will always experience some page faults, if for no other reason than because a newly-launched application will experience page faults as it is brought into memory.