< prev index next >

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

Print this page
rev 48019 : 8191821: Finer granularity for GC verification
Reviewed-by:
rev 48020 : [mq]: 8191821-rev-sang-poonam


   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);


  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 }


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


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