From 3d2c024ea45e929338355bcb83f2b1adf0384074 Mon Sep 17 00:00:00 2001
From: Ivan Galkin <ivan.galkin@sap.com>
Date: Wed, 4 Nov 2015 10:12:37 -0800
Subject: [PATCH] 8135318: CMS wrong max_eden_size for check_gc_overhead_limit

Reviewed-by: jmasa, simonis
---
 hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
index 25f3d2fd435..7c7cb0ec579 100644
--- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
@@ -1542,9 +1542,7 @@ void CMSCollector::acquire_control_and_collect(bool full,
   do_compaction_work(clear_all_soft_refs);
 
   // Has the GC time limit been exceeded?
-  size_t max_eden_size = _young_gen->max_capacity() -
-                         _young_gen->to()->capacity() -
-                         _young_gen->from()->capacity();
+  size_t max_eden_size = _young_gen->max_eden_size();
   GCCause::Cause gc_cause = gch->gc_cause();
   size_policy()->check_gc_overhead_limit(_young_gen->used(),
                                          _young_gen->eden()->used(),