title: Concurrent Mark Sweep (CMS) GC occurs when Minor Collection runs
body: <p>We are using Java 1.6 Hotspot JVM. CMS GC should run when the Old Gen is nearing capacity. Minor Collection runs when Young Gen is nearing capacity. </p>
  
  <p>However, on one server we are getting a CMS GC everytime a Minor Collection occurs. On the second server, this does not happen (normal operation). The jvm options are exactly the same on both servers; this happened after we upgraded to 64 bit webserver and JRE. JVM options are below:</p>
  
  <pre><code>&lt;jvm-options&gt;-Xms4096M -Xmx4096M&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-server&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-Xss256k&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:NewSize=392M&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:MaxNewSize=392M&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+DisableExplicitGC&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+UseParNewGC&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+PrintClassHistogram&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+PrintGCDateStamps&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+UseConcMarkSweepGC&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+PrintGCDetails&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:PermSize=80m&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:MaxPermSize=80m&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-d64&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+CMSIncrementalMode&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:+CMSIncrementalPacing&lt;/jvm-options&gt;
  &lt;jvm-options&gt;-XX:CMSIncrementalSafetyFactor=75&lt;/jvm-options&gt;
  </code></pre>
  
  <p>The CMSInitiatingOccupancyFraction is not set, hence it is default value. What could be causing this? Can the two JVMs have different default values for non-defined JVM parameters?</p>
  
  <p>Please take a look at the GC log below. The first line is the Minor Collection. A fraction of a second later, the CMS GC runs when it is only 10% full.</p>
  
  <pre><code>2013-02-28T13:49:55.446-0500: 1052247.742: [GC 1052247.742: [ParNew: 334791K-&gt;12629K(361280K), 0.0402234 secs] 687147K-&gt;366075K(4154176K) icms_dc=100 , 0.0409779 secs] [Times: user=0.28 sys=0.00, real=0.04 secs]
  2013-02-28T13:49:55.505-0500: 1052247.801: [GC [1 CMS-initial-mark: 353445K(3792896K)] 366282K(4154176K), 0.0581835 secs] [Times: user=0.06 sys=0.01, real=0.06 secs]
  2013-02-28T13:49:55.565-0500: 1052247.860: [CMS-concurrent-mark-start]
  2013-02-28T13:49:56.713-0500: 1052249.009: [CMS-concurrent-mark: 0.796/1.148 secs] [Times: user=6.03 sys=0.04, real=1.15 secs]
  2013-02-28T13:49:56.713-0500: 1052249.009: [CMS-concurrent-preclean-start]
  2013-02-28T13:49:56.808-0500: 1052249.104: [CMS-concurrent-preclean: 0.094/0.095 secs] [Times: user=0.11 sys=0.00, real=0.10 secs]
  2013-02-28T13:49:56.808-0500: 1052249.104: [CMS-concurrent-abortable-preclean-start] 
    CMS: abort preclean due to time 2013-02-28T13:50:01.892-0500: 1052254.188: [CMS-concurrent-abortable-preclean: 5.080/5.083 secs] [Times: user=5.98 sys=0.11, real=5.08 secs]
  2013-02-28T13:50:01.911-0500: 1052254.207: [GC[YG occupancy: 56184 K (361280 K)]1052254.207: [Rescan (parallel) , 0.0413292 secs]1052254.249: [weak refs processing, 0.0001292 secs] [1 CMS-remark: 353445K(3792896K)] 409629K(4154176K), 0.0421145 secs] [Times: user=0.63 sys=0.02, real=0.04 secs]
  2013-02-28T13:50:01.954-0500: 1052254.250: [CMS-concurrent-sweep-start]
  2013-02-28T13:50:04.032-0500: 1052256.328: [CMS-concurrent-sweep: 2.078/2.078 secs] [Times: user=2.40 sys=0.03, real=2.08 secs]
  2013-02-28T13:50:04.032-0500: 1052256.328: [CMS-concurrent-reset-start]
  2013-02-28T13:50:04.050-0500: 1052256.346: [CMS-concurrent-reset: 0.018/0.018 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
  2013-02-28T13:50:44.487-0500: 1052296.783: [GC 1052296.783: [ParNew: 333781K-&gt;12385K(361280K), 0.0377823 secs] 686314K-&gt;366061K(4154176K) icms_dc=100 , 0.0385722 secs] [Times: user=0.29 sys=0.00, real=0.04 secs]
  2013-02-28T13:50:44.544-0500: 1052296.840: [GC [1 CMS-initial-mark: 353676K(3792896K)] 366257K(4154176K), 0.0562739 secs] [Times: user=0.06 sys=0.00, real=0.06 secs]
  2013-02-28T13:50:44.601-0500: 1052296.897: [CMS-concurrent-mark-start]
  2013-02-28T13:50:45.420-0500: 1052297.716: [CMS-concurrent-mark: 0.784/0.819 secs] [Times: user=5.79 sys=0.02, real=0.82 secs]
  2013-02-28T13:50:45.420-0500: 1052297.716: [CMS-concurrent-preclean-start]
  2013-02-28T13:50:45.517-0500: 1052297.813: [CMS-concurrent-preclean: 0.096/0.097 secs] [Times: user=0.12 sys=0.00, real=0.10 secs]
  2013-02-28T13:50:45.518-0500: 1052297.813: [CMS-concurrent-abortable-preclean-start]
    CMS: abort preclean due to time 2013-02-28T13:50:50.524-0500: 1052302.820: [CMS-concurrent-abortable-preclean: 4.903/5.006 secs] [Times: user=5.39 sys=0.05, real=5.01 secs]
  2013-02-28T13:50:50.543-0500: 1052302.839: [GC[YG occupancy: 49968 K (361280 K)]1052302.839: [Rescan (parallel) , 0.0695454 secs]1052302.909: [weak refs processing, 0.0001064 secs] [1 CMS-remark: 353676K(3792896K)] 403644K(4154176K), 0.0702712 secs]    
  </code></pre>