src/share/vm/memory/sharedHeap.cpp

Print this page




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

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




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