src/share/vm/memory/sharedHeap.cpp

Print this page




  48   SH_PS_jvmti_oops_do,
  49   SH_PS_StringTable_oops_do,
  50   SH_PS_CodeCache_oops_do,
  51   // Leave this one last.
  52   SH_PS_NumElements
  53 };
  54 
  55 SharedHeap::SharedHeap(CollectorPolicy* policy_) :
  56   CollectedHeap(),
  57   _collector_policy(policy_),
  58   _rem_set(NULL),
  59   _strong_roots_parity(0),
  60   _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
  61   _workers(NULL)
  62 {
  63   if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
  64     vm_exit_during_initialization("Failed necessary allocation.");
  65   }
  66   _sh = this;  // ch is static, should be set only once.
  67   if ((UseParNewGC ||
  68       (UseConcMarkSweepGC && CMSParallelRemarkEnabled) ||

  69        UseG1GC) &&
  70       ParallelGCThreads > 0) {
  71     _workers = new FlexibleWorkGang("Parallel GC Threads", ParallelGCThreads,
  72                             /* are_GC_task_threads */true,
  73                             /* are_ConcurrentGC_threads */false);
  74     if (_workers == NULL) {
  75       vm_exit_during_initialization("Failed necessary allocation.");
  76     } else {
  77       _workers->initialize_workers();
  78     }
  79   }
  80 }
  81 
  82 int SharedHeap::n_termination() {
  83   return _process_strong_tasks->n_threads();
  84 }
  85 
  86 void SharedHeap::set_n_termination(int t) {
  87   _process_strong_tasks->set_n_threads(t);
  88 }




  48   SH_PS_jvmti_oops_do,
  49   SH_PS_StringTable_oops_do,
  50   SH_PS_CodeCache_oops_do,
  51   // Leave this one last.
  52   SH_PS_NumElements
  53 };
  54 
  55 SharedHeap::SharedHeap(CollectorPolicy* policy_) :
  56   CollectedHeap(),
  57   _collector_policy(policy_),
  58   _rem_set(NULL),
  59   _strong_roots_parity(0),
  60   _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
  61   _workers(NULL)
  62 {
  63   if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
  64     vm_exit_during_initialization("Failed necessary allocation.");
  65   }
  66   _sh = this;  // ch is static, should be set only once.
  67   if ((UseParNewGC ||
  68       (UseConcMarkSweepGC && (CMSParallelInitialMarkEnabled ||
  69                               CMSParallelRemarkEnabled)) ||
  70        UseG1GC) &&
  71       ParallelGCThreads > 0) {
  72     _workers = new FlexibleWorkGang("Parallel GC Threads", ParallelGCThreads,
  73                             /* are_GC_task_threads */true,
  74                             /* are_ConcurrentGC_threads */false);
  75     if (_workers == NULL) {
  76       vm_exit_during_initialization("Failed necessary allocation.");
  77     } else {
  78       _workers->initialize_workers();
  79     }
  80   }
  81 }
  82 
  83 int SharedHeap::n_termination() {
  84   return _process_strong_tasks->n_threads();
  85 }
  86 
  87 void SharedHeap::set_n_termination(int t) {
  88   _process_strong_tasks->set_n_threads(t);
  89 }