< prev index next >

src/hotspot/share/gc/g1/g1Arguments.cpp

Print this page
rev 47796 : 8189171: Move GC argument processing into GC specific classes
Reviewed-by: pliden, eosterlund
rev 47797 : 8189389: Move heap creation into GC interface


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1Arguments.hpp"


  27 #include "gc/g1/heapRegion.hpp"

  28 #include "runtime/globals.hpp"
  29 #include "runtime/globals_extension.hpp"
  30 #include "runtime/vm_version.hpp"
  31 
  32 size_t G1Arguments::conservative_max_heap_alignment() {
  33   return HeapRegion::max_region_size();
  34 }
  35 
  36 void G1Arguments::initialize_flags() {
  37   GCArguments::initialize_flags();
  38   assert(UseG1GC, "Error");
  39 #if defined(COMPILER1) || INCLUDE_JVMCI
  40   FastTLABRefill = false;
  41 #endif
  42   FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
  43   if (ParallelGCThreads == 0) {
  44     assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
  45     vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
  46   }
  47 


  72   // arrange that the pause interval to be pause time target + 1 to
  73   // ensure that a) the pause time target is maximized with respect to
  74   // the pause interval and b) we maintain the invariant that pause
  75   // time target < pause interval. If the user does not want this
  76   // maximum flexibility, they will have to set the pause interval
  77   // explicitly.
  78 
  79   if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) {
  80     // The default pause time target in G1 is 200ms
  81     FLAG_SET_DEFAULT(MaxGCPauseMillis, 200);
  82   }
  83 
  84   // Then, if the interval parameter was not set, set it according to
  85   // the pause time target (this will also deal with the case when the
  86   // pause time target is the default value).
  87   if (FLAG_IS_DEFAULT(GCPauseIntervalMillis)) {
  88     FLAG_SET_DEFAULT(GCPauseIntervalMillis, MaxGCPauseMillis + 1);
  89   }
  90 
  91   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));




  92 }


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1Arguments.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/g1CollectorPolicy.hpp"
  29 #include "gc/g1/heapRegion.hpp"
  30 #include "gc/shared/gcArguments.inline.hpp"
  31 #include "runtime/globals.hpp"
  32 #include "runtime/globals_extension.hpp"
  33 #include "runtime/vm_version.hpp"
  34 
  35 size_t G1Arguments::conservative_max_heap_alignment() {
  36   return HeapRegion::max_region_size();
  37 }
  38 
  39 void G1Arguments::initialize_flags() {
  40   GCArguments::initialize_flags();
  41   assert(UseG1GC, "Error");
  42 #if defined(COMPILER1) || INCLUDE_JVMCI
  43   FastTLABRefill = false;
  44 #endif
  45   FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
  46   if (ParallelGCThreads == 0) {
  47     assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
  48     vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
  49   }
  50 


  75   // arrange that the pause interval to be pause time target + 1 to
  76   // ensure that a) the pause time target is maximized with respect to
  77   // the pause interval and b) we maintain the invariant that pause
  78   // time target < pause interval. If the user does not want this
  79   // maximum flexibility, they will have to set the pause interval
  80   // explicitly.
  81 
  82   if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) {
  83     // The default pause time target in G1 is 200ms
  84     FLAG_SET_DEFAULT(MaxGCPauseMillis, 200);
  85   }
  86 
  87   // Then, if the interval parameter was not set, set it according to
  88   // the pause time target (this will also deal with the case when the
  89   // pause time target is the default value).
  90   if (FLAG_IS_DEFAULT(GCPauseIntervalMillis)) {
  91     FLAG_SET_DEFAULT(GCPauseIntervalMillis, MaxGCPauseMillis + 1);
  92   }
  93 
  94   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
  95 }
  96 
  97 CollectedHeap* G1Arguments::create_heap() {
  98   return create_heap_with_policy<G1CollectedHeap, G1CollectorPolicy>();
  99 }
< prev index next >