It is Window 2003 server.

We are running some performance test, and what we see is: 1. In first 5 hours, the page fault/sec is very small, like 10 or 20

  1. In the last 1 hour, the page fault jumps to 500 page fault/sec

  2. In the last 1 hour, we see the java server will stop logging anything for 6-7 seconds, and then resume back. This happened about 200 times in the last 1 hour.

  3. We suspect it is because of JVM Garbage Collection.

What I want to know is that when JVM is doing GC, is it expected to see a big amount of page fault/sec compared to no GC?



When you do garbage collection, you tend to access a large number of pages that haven't been accessed recently. Many of these pages were probably considered candidates for eviction should the system encounter memory pressure.

The first such access to each such page (or group of pages managed as a unit) requires the OS to remove them from the set of eviction candidates and instead consider them recently-accessed. This requires a soft page fault to give the OS a chance to change the accounting.

Lots of pages accessed that haven't been accessed recently means lots of soft page faults.

  • What if we have plenty of RAM, like 64G, and the whole system is using only 20G. Are we suppose to see big page fault/sec? I don't think so since everything can stay at RAM. – performanceuser Apr 1 '13 at 22:45
  • Yes, you are. Otherwise, how would the OS know to keep the pages in RAM? (The page faults are what tells the OS that the page is being accessed. Without a page fault, the OS has no idea what memory is being accessed.) – David Schwartz Apr 1 '13 at 22:53
  • But if all the memory are in the RAM, when the application tries to access a virtual address, is it suppose to be mapped to a physical address without a page fault? – performanceuser Apr 2 '13 at 14:36
  • @performanceuser: You mean without a hard page fault. Hard page faults are not the only kinds of page faults. How do you think the OS decides what data to keep in RAM? Without page faults, it would have no idea that the data was being accessed. (The page faults invoke the OS's page handler which marks that the pages have been accessed so it knows to keep them in RAM. Otherwise, it would have no idea which pages were being accessed, and thus should be kept in RAM, and which weren't, and thus shouldn't.) – David Schwartz Apr 2 '13 at 18:20
  • So you agree that there should not be any hard page faults, right? In my case, OS should have enough RAM to keep everything in physical memory, so there is no hard page fault. Then I don't understand during GC, why there are lots of other kinds of page fault happen? During GC, it just try to access all the object that has been created by application. Why there is a soft page fault then? – performanceuser Apr 4 '13 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.