United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6941122 G1: UseLargePages does not work with G1 garbage collector
JDK-6941122 : G1: UseLargePages does not work with G1 garbage collector

Details
Type:
Enhancement
Submit Date:
2010-04-06
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
solaris_8
Sub-Component:
gc
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u18
Fixed Versions:
hs20 (b07)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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

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.
                                     
2010-12-20
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.
                                     
2011-01-13
EVALUATION

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



Hardware and Software, Engineered to Work Together