Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6899269

UseLargePages fails when combined with UseConcMarkSweepGC + UseCompressedOops

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • hs15
    • 6u16
    • hotspot
    • gc
    • x86
    • linux

      FULL PRODUCT VERSION :
      java version "1.6.0_16"
      Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

      FULL OS VERSION :
      Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      32GB memory

      A DESCRIPTION OF THE PROBLEM :
      When using Linux, UseLargePages refuses to work if the UseConcMarkSweepGC and UseCompressedOops options are also specified.

      This fails:
      sudo java -Xmx128M -Xms128M -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseLargePages HelloWorld
      Java HotSpot(TM) 64-Bit Server VM warning: Failed to attach shared memory (errno = 22).

      If either UseConcMarkSweepGC or UseLargePages is removed from the command line things work fine.

      This was taken from a forum post at http://forums.sun.com/thread.jspa?threadID=5390741&tstart=0 which wasn't getting a response. It would be really nice for us to be able to use all three of these options together, as the parallel GC takes too long for our large 27GB heap.

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

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Set up a Linux environment with Large Page support and allocate sufficient pages
      2. Write a simple "Hello World" java application
      3. Attempt to start it with -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseLargePages and note the failure
      4. Attempt to start it with -XX:+UseConcMarkSweepGC -XX:+UseLargePages and note that it succeeds
      5. Attempt to start it with -XX:+UseCompressedOops -XX:+UseLargePages and note that it succeeds

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      When using all three options, the JVM fails with error message:
      Java HotSpot(TM) 64-Bit Server VM warning: Failed to attach shared memory (errno = 22).

      The expected result is that the JVM starts properly when the three options are combined.
      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Java HotSpot(TM) 64-Bit Server VM warning: Failed to attach shared memory (errno = 22).

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      class HelloWorld {
          public static void main(String[] args) {
              System.out.println("Hello World!");
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The workaround is to either use a different GC, or not use Large Pages, but it would be very nice to be able to use all three options, since they are all very beneficial.

            ysr Y. Ramakrishna
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: