When the JVM is doing a complete GC, is it expected to see a large number of page fault/sec?

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?

Answer

Yes.

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.

Attribution
Source : Link , Question Author : performanceuser , Answer Author : David Schwartz

Leave a Comment