src/share/vm/gc/g1/concurrentG1Refine.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc/g1

src/share/vm/gc/g1/concurrentG1Refine.cpp

Print this page




  26 #include "gc/g1/concurrentG1Refine.hpp"
  27 #include "gc/g1/concurrentG1RefineThread.hpp"
  28 #include "gc/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc/g1/g1HotCardCache.hpp"
  30 #include "runtime/java.hpp"
  31 
  32 ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) :
  33   _threads(NULL),
  34   _sample_thread(NULL),
  35   _hot_card_cache(g1h)
  36 {
  37   // Ergonomically select initial concurrent refinement parameters
  38   if (FLAG_IS_DEFAULT(G1ConcRefinementGreenZone)) {
  39     FLAG_SET_DEFAULT(G1ConcRefinementGreenZone, (intx)ParallelGCThreads);
  40   }
  41   set_green_zone(G1ConcRefinementGreenZone);
  42 
  43   if (FLAG_IS_DEFAULT(G1ConcRefinementYellowZone)) {
  44     FLAG_SET_DEFAULT(G1ConcRefinementYellowZone, green_zone() * 3);
  45   }
  46   set_yellow_zone(MAX2<int>(G1ConcRefinementYellowZone, green_zone()));
  47 
  48   if (FLAG_IS_DEFAULT(G1ConcRefinementRedZone)) {
  49     FLAG_SET_DEFAULT(G1ConcRefinementRedZone, yellow_zone() * 2);
  50   }
  51   set_red_zone(MAX2<int>(G1ConcRefinementRedZone, yellow_zone()));
  52 }
  53 
  54 ConcurrentG1Refine* ConcurrentG1Refine::create(G1CollectedHeap* g1h, CardTableEntryClosure* refine_closure, jint* ecode) {
  55   ConcurrentG1Refine* cg1r = new ConcurrentG1Refine(g1h);
  56   if (cg1r == NULL) {
  57     *ecode = JNI_ENOMEM;
  58     vm_shutdown_during_initialization("Could not create ConcurrentG1Refine");
  59     return NULL;
  60   }
  61   cg1r->_n_worker_threads = thread_num();
  62 
  63   cg1r->reset_threshold_step();
  64 
  65   cg1r->_threads = NEW_C_HEAP_ARRAY_RETURN_NULL(ConcurrentG1RefineThread*, cg1r->_n_worker_threads, mtGC);
  66   if (cg1r->_threads == NULL) {
  67     *ecode = JNI_ENOMEM;
  68     vm_shutdown_during_initialization("Could not allocate an array for ConcurrentG1RefineThread");
  69     return NULL;
  70   }
  71 




  26 #include "gc/g1/concurrentG1Refine.hpp"
  27 #include "gc/g1/concurrentG1RefineThread.hpp"
  28 #include "gc/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc/g1/g1HotCardCache.hpp"
  30 #include "runtime/java.hpp"
  31 
  32 ConcurrentG1Refine::ConcurrentG1Refine(G1CollectedHeap* g1h) :
  33   _threads(NULL),
  34   _sample_thread(NULL),
  35   _hot_card_cache(g1h)
  36 {
  37   // Ergonomically select initial concurrent refinement parameters
  38   if (FLAG_IS_DEFAULT(G1ConcRefinementGreenZone)) {
  39     FLAG_SET_DEFAULT(G1ConcRefinementGreenZone, (intx)ParallelGCThreads);
  40   }
  41   set_green_zone(G1ConcRefinementGreenZone);
  42 
  43   if (FLAG_IS_DEFAULT(G1ConcRefinementYellowZone)) {
  44     FLAG_SET_DEFAULT(G1ConcRefinementYellowZone, green_zone() * 3);
  45   }
  46   set_yellow_zone(MAX2<size_t>(G1ConcRefinementYellowZone, green_zone()));
  47 
  48   if (FLAG_IS_DEFAULT(G1ConcRefinementRedZone)) {
  49     FLAG_SET_DEFAULT(G1ConcRefinementRedZone, yellow_zone() * 2);
  50   }
  51   set_red_zone(MAX2<size_t>(G1ConcRefinementRedZone, yellow_zone()));
  52 }
  53 
  54 ConcurrentG1Refine* ConcurrentG1Refine::create(G1CollectedHeap* g1h, CardTableEntryClosure* refine_closure, jint* ecode) {
  55   ConcurrentG1Refine* cg1r = new ConcurrentG1Refine(g1h);
  56   if (cg1r == NULL) {
  57     *ecode = JNI_ENOMEM;
  58     vm_shutdown_during_initialization("Could not create ConcurrentG1Refine");
  59     return NULL;
  60   }
  61   cg1r->_n_worker_threads = thread_num();
  62 
  63   cg1r->reset_threshold_step();
  64 
  65   cg1r->_threads = NEW_C_HEAP_ARRAY_RETURN_NULL(ConcurrentG1RefineThread*, cg1r->_n_worker_threads, mtGC);
  66   if (cg1r->_threads == NULL) {
  67     *ecode = JNI_ENOMEM;
  68     vm_shutdown_during_initialization("Could not allocate an array for ConcurrentG1RefineThread");
  69     return NULL;
  70   }
  71 


src/share/vm/gc/g1/concurrentG1Refine.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File