src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp

Print this page

        

@@ -443,11 +443,16 @@
       size_policy->update_averages(_survivor_overflow, survived, promoted);
 
       // A successful scavenge should restart the GC time limit count which is
       // for full GC's.
       size_policy->reset_gc_overhead_limit_count();
-      if (UseAdaptiveSizePolicy) {
+      if (PSResizeByFreeRatioWithSystemGC &&
+          gc_cause == GCCause::_java_lang_system_gc) {
+        ParallelScavengeHeap* heap = (ParallelScavengeHeap*) Universe::heap();
+        heap->resize_by_free_ratio(false);
+
+      } else if (UseAdaptiveSizePolicy) {
         // Calculate the new survivor size and tenuring threshold
 
         if (PrintAdaptiveSizePolicy) {
           gclog_or_tty->print("AdaptiveSizeStart: ");
           gclog_or_tty->stamp();

@@ -539,10 +544,13 @@
 
         if (PrintAdaptiveSizePolicy) {
           gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
                          heap->total_collections());
         }
+      } else {
+        ParallelScavengeHeap* heap = (ParallelScavengeHeap*) Universe::heap();
+        heap->resize_by_free_ratio(false);
       }
 
       // Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can
       // cause the change of the heap layout. Make sure eden is reshaped if that's the case.
       // Also update() will case adaptive NUMA chunk resizing.