532 }
533 assert(_markBitMap.covers(_span), "_markBitMap inconsistency?");
534 }
535 {
536 _modUnionTable.allocate(_span);
537 assert(_modUnionTable.covers(_span), "_modUnionTable inconsistency?");
538 }
539
540 if (!_markStack.allocate(MarkStackSize)) {
541 warning("Failed to allocate CMS Marking Stack");
542 return;
543 }
544
545 // Support for multi-threaded concurrent phases
546 if (CMSConcurrentMTEnabled) {
547 if (FLAG_IS_DEFAULT(ConcGCThreads)) {
548 // just for now
549 FLAG_SET_DEFAULT(ConcGCThreads, (ParallelGCThreads + 3)/4);
550 }
551 if (ConcGCThreads > 1) {
552 _conc_workers = new YieldingFlexibleWorkGang("Parallel CMS Threads",
553 ConcGCThreads, true);
554 if (_conc_workers == NULL) {
555 warning("GC/CMS: _conc_workers allocation failure: "
556 "forcing -CMSConcurrentMTEnabled");
557 CMSConcurrentMTEnabled = false;
558 } else {
559 _conc_workers->initialize_workers();
560 }
561 } else {
562 CMSConcurrentMTEnabled = false;
563 }
564 }
565 if (!CMSConcurrentMTEnabled) {
566 ConcGCThreads = 0;
567 } else {
568 // Turn off CMSCleanOnEnter optimization temporarily for
569 // the MT case where it's not fixed yet; see 6178663.
570 CMSCleanOnEnter = false;
571 }
572 assert((_conc_workers != NULL) == (ConcGCThreads > 1),
|
532 }
533 assert(_markBitMap.covers(_span), "_markBitMap inconsistency?");
534 }
535 {
536 _modUnionTable.allocate(_span);
537 assert(_modUnionTable.covers(_span), "_modUnionTable inconsistency?");
538 }
539
540 if (!_markStack.allocate(MarkStackSize)) {
541 warning("Failed to allocate CMS Marking Stack");
542 return;
543 }
544
545 // Support for multi-threaded concurrent phases
546 if (CMSConcurrentMTEnabled) {
547 if (FLAG_IS_DEFAULT(ConcGCThreads)) {
548 // just for now
549 FLAG_SET_DEFAULT(ConcGCThreads, (ParallelGCThreads + 3)/4);
550 }
551 if (ConcGCThreads > 1) {
552 _conc_workers = new YieldingFlexibleWorkGang("CMS Threads",
553 ConcGCThreads, true);
554 if (_conc_workers == NULL) {
555 warning("GC/CMS: _conc_workers allocation failure: "
556 "forcing -CMSConcurrentMTEnabled");
557 CMSConcurrentMTEnabled = false;
558 } else {
559 _conc_workers->initialize_workers();
560 }
561 } else {
562 CMSConcurrentMTEnabled = false;
563 }
564 }
565 if (!CMSConcurrentMTEnabled) {
566 ConcGCThreads = 0;
567 } else {
568 // Turn off CMSCleanOnEnter optimization temporarily for
569 // the MT case where it's not fixed yet; see 6178663.
570 CMSCleanOnEnter = false;
571 }
572 assert((_conc_workers != NULL) == (ConcGCThreads > 1),
|