< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Print this page




  29 #include "gc/shared/gcArguments.hpp"
  30 #include "gc/shared/gcTimer.hpp"
  31 #include "gc/shared/gcTraceTime.inline.hpp"
  32 #include "gc/shared/locationPrinter.inline.hpp"
  33 #include "gc/shared/memAllocator.hpp"
  34 #include "gc/shared/oopStorageSet.hpp"
  35 #include "gc/shared/plab.hpp"
  36 
  37 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  38 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
  39 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
  40 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
  41 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
  42 #include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
  43 #include "gc/shenandoah/shenandoahControlThread.hpp"
  44 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  45 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  46 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  47 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
  48 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"

  49 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
  50 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
  51 #include "gc/shenandoah/shenandoahMemoryPool.hpp"
  52 #include "gc/shenandoah/shenandoahMetrics.hpp"
  53 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
  54 #include "gc/shenandoah/shenandoahNormalMode.hpp"
  55 #include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
  56 #include "gc/shenandoah/shenandoahPacer.inline.hpp"
  57 #include "gc/shenandoah/shenandoahPadding.hpp"
  58 #include "gc/shenandoah/shenandoahParallelCleaning.inline.hpp"
  59 #include "gc/shenandoah/shenandoahPassiveMode.hpp"
  60 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
  61 #include "gc/shenandoah/shenandoahStringDedup.hpp"
  62 #include "gc/shenandoah/shenandoahTaskqueue.hpp"
  63 #include "gc/shenandoah/shenandoahTraversalMode.hpp"
  64 #include "gc/shenandoah/shenandoahUtils.hpp"
  65 #include "gc/shenandoah/shenandoahVerifier.hpp"
  66 #include "gc/shenandoah/shenandoahCodeRoots.hpp"
  67 #include "gc/shenandoah/shenandoahVMOperations.hpp"
  68 #include "gc/shenandoah/shenandoahWorkGroup.hpp"


 354     ShenandoahSATBMarkQueueSet& satbqs = ShenandoahBarrierSet::satb_mark_queue_set();
 355     satbqs.set_process_completed_buffers_threshold(20); // G1SATBProcessCompletedThreshold
 356     satbqs.set_buffer_enqueue_threshold_percentage(60); // G1SATBBufferEnqueueingThresholdPercent
 357   }
 358 
 359   _monitoring_support = new ShenandoahMonitoringSupport(this);
 360   _phase_timings = new ShenandoahPhaseTimings();
 361   ShenandoahStringDedup::initialize();
 362   ShenandoahCodeRoots::initialize();
 363 
 364   if (ShenandoahPacing) {
 365     _pacer = new ShenandoahPacer(this);
 366     _pacer->setup_for_idle();
 367   } else {
 368     _pacer = NULL;
 369   }
 370 
 371   _traversal_gc = strcmp(ShenandoahGCMode, "traversal") == 0 ?
 372                   new ShenandoahTraversalGC(this) :
 373                   NULL;
 374 
 375   _control_thread = new ShenandoahControlThread();
 376 
 377   log_info(gc, init)("Initialize Shenandoah heap: " SIZE_FORMAT "%s initial, " SIZE_FORMAT "%s min, " SIZE_FORMAT "%s max",
 378                      byte_size_in_proper_unit(_initial_size),  proper_unit_for_byte_size(_initial_size),
 379                      byte_size_in_proper_unit(_minimum_size),  proper_unit_for_byte_size(_minimum_size),
 380                      byte_size_in_proper_unit(max_capacity()), proper_unit_for_byte_size(max_capacity())
 381   );
 382 
 383   log_info(gc, init)("Safepointing mechanism: %s",
 384                      SafepointMechanism::uses_thread_local_poll() ? "thread-local poll" :
 385                      (SafepointMechanism::uses_global_page_poll() ? "global-page poll" : "unknown"));
 386 
 387   return JNI_OK;
 388 }
 389 
 390 void ShenandoahHeap::initialize_heuristics() {
 391   if (ShenandoahGCMode != NULL) {
 392     if (strcmp(ShenandoahGCMode, "traversal") == 0) {
 393       _gc_mode = new ShenandoahTraversalMode();
 394     } else if (strcmp(ShenandoahGCMode, "normal") == 0) {
 395       _gc_mode = new ShenandoahNormalMode();


 396     } else if (strcmp(ShenandoahGCMode, "passive") == 0) {
 397       _gc_mode = new ShenandoahPassiveMode();
 398     } else {
 399       vm_exit_during_initialization("Unknown -XX:ShenandoahGCMode option");
 400     }
 401   } else {
 402     ShouldNotReachHere();
 403   }
 404   _gc_mode->initialize_flags();
 405   _heuristics = _gc_mode->initialize_heuristics();
 406 
 407   if (_heuristics->is_diagnostic() && !UnlockDiagnosticVMOptions) {
 408     vm_exit_during_initialization(
 409             err_msg("Heuristics \"%s\" is diagnostic, and must be enabled via -XX:+UnlockDiagnosticVMOptions.",
 410                     _heuristics->name()));
 411   }
 412   if (_heuristics->is_experimental() && !UnlockExperimentalVMOptions) {
 413     vm_exit_during_initialization(
 414             err_msg("Heuristics \"%s\" is experimental, and must be enabled via -XX:+UnlockExperimentalVMOptions.",
 415                     _heuristics->name()));




  29 #include "gc/shared/gcArguments.hpp"
  30 #include "gc/shared/gcTimer.hpp"
  31 #include "gc/shared/gcTraceTime.inline.hpp"
  32 #include "gc/shared/locationPrinter.inline.hpp"
  33 #include "gc/shared/memAllocator.hpp"
  34 #include "gc/shared/oopStorageSet.hpp"
  35 #include "gc/shared/plab.hpp"
  36 
  37 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  38 #include "gc/shenandoah/shenandoahClosures.inline.hpp"
  39 #include "gc/shenandoah/shenandoahCollectionSet.hpp"
  40 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
  41 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
  42 #include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
  43 #include "gc/shenandoah/shenandoahControlThread.hpp"
  44 #include "gc/shenandoah/shenandoahFreeSet.hpp"
  45 #include "gc/shenandoah/shenandoahPhaseTimings.hpp"
  46 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
  47 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
  48 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
  49 #include "gc/shenandoah/shenandoahIUMode.hpp"
  50 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
  51 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
  52 #include "gc/shenandoah/shenandoahMemoryPool.hpp"
  53 #include "gc/shenandoah/shenandoahMetrics.hpp"
  54 #include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
  55 #include "gc/shenandoah/shenandoahNormalMode.hpp"
  56 #include "gc/shenandoah/shenandoahOopClosures.inline.hpp"
  57 #include "gc/shenandoah/shenandoahPacer.inline.hpp"
  58 #include "gc/shenandoah/shenandoahPadding.hpp"
  59 #include "gc/shenandoah/shenandoahParallelCleaning.inline.hpp"
  60 #include "gc/shenandoah/shenandoahPassiveMode.hpp"
  61 #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
  62 #include "gc/shenandoah/shenandoahStringDedup.hpp"
  63 #include "gc/shenandoah/shenandoahTaskqueue.hpp"
  64 #include "gc/shenandoah/shenandoahTraversalMode.hpp"
  65 #include "gc/shenandoah/shenandoahUtils.hpp"
  66 #include "gc/shenandoah/shenandoahVerifier.hpp"
  67 #include "gc/shenandoah/shenandoahCodeRoots.hpp"
  68 #include "gc/shenandoah/shenandoahVMOperations.hpp"
  69 #include "gc/shenandoah/shenandoahWorkGroup.hpp"


 355     ShenandoahSATBMarkQueueSet& satbqs = ShenandoahBarrierSet::satb_mark_queue_set();
 356     satbqs.set_process_completed_buffers_threshold(20); // G1SATBProcessCompletedThreshold
 357     satbqs.set_buffer_enqueue_threshold_percentage(60); // G1SATBBufferEnqueueingThresholdPercent
 358   }
 359 
 360   _monitoring_support = new ShenandoahMonitoringSupport(this);
 361   _phase_timings = new ShenandoahPhaseTimings();
 362   ShenandoahStringDedup::initialize();
 363   ShenandoahCodeRoots::initialize();
 364 
 365   if (ShenandoahPacing) {
 366     _pacer = new ShenandoahPacer(this);
 367     _pacer->setup_for_idle();
 368   } else {
 369     _pacer = NULL;
 370   }
 371 
 372   _traversal_gc = strcmp(ShenandoahGCMode, "traversal") == 0 ?
 373                   new ShenandoahTraversalGC(this) :
 374                   NULL;

 375   _control_thread = new ShenandoahControlThread();
 376 
 377   log_info(gc, init)("Initialize Shenandoah heap: " SIZE_FORMAT "%s initial, " SIZE_FORMAT "%s min, " SIZE_FORMAT "%s max",
 378                      byte_size_in_proper_unit(_initial_size),  proper_unit_for_byte_size(_initial_size),
 379                      byte_size_in_proper_unit(_minimum_size),  proper_unit_for_byte_size(_minimum_size),
 380                      byte_size_in_proper_unit(max_capacity()), proper_unit_for_byte_size(max_capacity())
 381   );
 382 
 383   log_info(gc, init)("Safepointing mechanism: %s",
 384                      SafepointMechanism::uses_thread_local_poll() ? "thread-local poll" :
 385                      (SafepointMechanism::uses_global_page_poll() ? "global-page poll" : "unknown"));
 386 
 387   return JNI_OK;
 388 }
 389 
 390 void ShenandoahHeap::initialize_heuristics() {
 391   if (ShenandoahGCMode != NULL) {
 392     if (strcmp(ShenandoahGCMode, "traversal") == 0) {
 393       _gc_mode = new ShenandoahTraversalMode();
 394     } else if (strcmp(ShenandoahGCMode, "normal") == 0) {
 395       _gc_mode = new ShenandoahNormalMode();
 396     } else if (strcmp(ShenandoahGCMode, "iu") == 0) {
 397       _gc_mode = new ShenandoahIUMode();
 398     } else if (strcmp(ShenandoahGCMode, "passive") == 0) {
 399       _gc_mode = new ShenandoahPassiveMode();
 400     } else {
 401       vm_exit_during_initialization("Unknown -XX:ShenandoahGCMode option");
 402     }
 403   } else {
 404     ShouldNotReachHere();
 405   }
 406   _gc_mode->initialize_flags();
 407   _heuristics = _gc_mode->initialize_heuristics();
 408 
 409   if (_heuristics->is_diagnostic() && !UnlockDiagnosticVMOptions) {
 410     vm_exit_during_initialization(
 411             err_msg("Heuristics \"%s\" is diagnostic, and must be enabled via -XX:+UnlockDiagnosticVMOptions.",
 412                     _heuristics->name()));
 413   }
 414   if (_heuristics->is_experimental() && !UnlockExperimentalVMOptions) {
 415     vm_exit_during_initialization(
 416             err_msg("Heuristics \"%s\" is experimental, and must be enabled via -XX:+UnlockExperimentalVMOptions.",
 417                     _heuristics->name()));


< prev index next >