JDK-6941122 : G1: UseLargePages does not work with G1 garbage collector
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 6u18
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: x86
  • Submitted: 2010-04-06
  • Updated: 2013-09-18
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u25Fixed 7Fixed hs20Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
1.6.0_u18

FULL OS VERSION :
Redhat Enterprise Linux 4 Update 4

A DESCRIPTION OF THE PROBLEM :
When enabling the G1 garbage collector, UseLargePages ceases to have effect. This can be verified by executing the following command before and after starting the JVM:

cat /proc/meminfo | grep Huge

When the G1 garbage collector is enabled, the results of the preceding operation before and after starting the JVM are exactly the same. G1 is enabled with the following options:

-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

Using any other garbage collector (CMS, Parallel, Serial, etc.) causes the number of Huge pages available to be reduced as expected (depending on Xmx, Xms, etc. flags).

The system in question has been running with huge pages for many months now. We updated to the latest Java 6 Update 18 in order to try G1, however this conflicts with out huge page requirements (we use heaps above 16 GB).

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/2e0b0c4671e4
13-01-2011

SUGGESTED FIX We pass "false" as value for the "large" parameter in the ReservedSpace constructor. Instead we should pass "UseLargePages" which will let G1 use large pages if started with -XX:+UseLargePages.
13-01-2011

EVALUATION Quick update after talking with Bengt. - On Solaris G1 seems to be able to use large pages like all other GCs. - On Linux G1 was indeed not using large pages. Bengt tracked the issue down to the heap initialization code. When G1 initializes the heap it's using the heap region size as the desired alignment and, when the page size was larger than the heap region, large pages were somehow disabled on Linux. We'll need to use max(heap region size, page size) as the alignment it seems.
20-12-2010