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

SurvivorRatio is ignored when using -XX:+UseConcMarkSweepGC

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 1.4.2
    • Fix Version/s: 1.4.2_12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      java version "1.4.2_10"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
      Java HotSpot(TM) Server VM (build 1.4.2_10-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      C:\j2sdk1.4.2_10\bin\java.exe -XX:+UseConcMarkSweepGC -XX:-UseAdaptiveSizePolicy -XX:SurvivorRatio=1 -XX:+PrintTenuringDistribution -server -showversion -Xms256m -Xmx256m -XX:NewSize=64m -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps test

      0.000: [GC 0.000: [DefNew
      Desired survivor size 32768 bytes, new threshold 0 (max 0)
      : 65405K->0K(65472K), 0.0087114 secs] 65405K->84K(262080K), 0.0088707 secs]

      0.192: [GC 0.192: [DefNew
      Desired survivor size 32768 bytes, new threshold 0 (max 0)
      : 65407K->0K(65472K), 0.0041371 secs] 65492K->86K(262080K), 0.0042598 secs]

      0.377: [GC 0.377: [DefNew
      Desired survivor size 32768 bytes, new threshold 0 (max 0)
      : 65407K->0K(65472K), 0.0037346 secs] 65494K->89K(262080K), 0.0038483 secs]

      New generation is set to 64m, GC says that survivor size is only 32K
      and copies everything to old generation. which causes full GC
      more frequently than necessary


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      execute test , which allocates 1024 bytes for StringBuffer in a loop

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected to see Desired survivor size in megabytes
      ACTUAL -
      New generation is set to 64m, GC says that survivor size is only 32K
      and copies everything to old generation. which causes full GC
      more frequently than necessary


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class test
      {
      public static void main( String [] args )
      {
      StringBuffer s = null;
      long l = 0;
      while( true )
      { s = new StringBuffer( 1024 );
      l++;
      if( l % 10000 == 0 )
      System.out.println( l );
      }
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      It was working in JDK 1.4.1 and is fixed in 1.5 but we have to use version 1.4.2_?? which still have this issue

        Attachments

          Activity

            People

            Assignee:
            asaha Abhijit Saha
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: