Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 2369:92da084fefc9
6668573: CMS: reference processing crash if ParallelCMSThreads > ParallelGCThreads
Summary: Use _max_num_q = max(discovery_degree, processing_degree), and let balance_queues() redistribute from discovery_degree to processing_degree of queues. This should also allow a more dynamic and flexible parallelism policy in the future.
Reviewed-by: jmasa, johnc
author | ysr |
---|---|
date | Thu, 17 Mar 2011 10:32:46 -0700 |
parents | 1216415d8e35 |
children | 455328d90876 |
comparison
equal
deleted
inserted
replaced
2368:dde920245681 | 2369:92da084fefc9 |
---|---|
1460 | 1460 |
1461 // See the comment in G1CollectedHeap::ref_processing_init() about | 1461 // See the comment in G1CollectedHeap::ref_processing_init() about |
1462 // how reference processing currently works in G1. | 1462 // how reference processing currently works in G1. |
1463 | 1463 |
1464 // Temporarily make reference _discovery_ single threaded (non-MT). | 1464 // Temporarily make reference _discovery_ single threaded (non-MT). |
1465 ReferenceProcessorMTMutator rp_disc_ser(ref_processor(), false); | 1465 ReferenceProcessorMTDiscoveryMutator rp_disc_ser(ref_processor(), false); |
1466 | 1466 |
1467 // Temporarily make refs discovery atomic | 1467 // Temporarily make refs discovery atomic |
1468 ReferenceProcessorAtomicMutator rp_disc_atomic(ref_processor(), true); | 1468 ReferenceProcessorAtomicMutator rp_disc_atomic(ref_processor(), true); |
1469 | 1469 |
1470 // Temporarily clear _is_alive_non_header | 1470 // Temporarily clear _is_alive_non_header |
2217 // * A full GC enables (non-MT) reference discovery and | 2217 // * A full GC enables (non-MT) reference discovery and |
2218 // processes any discovered references. | 2218 // processes any discovered references. |
2219 | 2219 |
2220 SharedHeap::ref_processing_init(); | 2220 SharedHeap::ref_processing_init(); |
2221 MemRegion mr = reserved_region(); | 2221 MemRegion mr = reserved_region(); |
2222 _ref_processor = ReferenceProcessor::create_ref_processor( | 2222 _ref_processor = |
2223 mr, // span | 2223 new ReferenceProcessor(mr, // span |
2224 false, // Reference discovery is not atomic | 2224 ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing |
2225 true, // mt_discovery | 2225 (int) ParallelGCThreads, // degree of mt processing |
2226 &_is_alive_closure, // is alive closure | 2226 ParallelGCThreads > 1 || ConcGCThreads > 1, // mt discovery |
2227 // for efficiency | 2227 (int) MAX2(ParallelGCThreads, ConcGCThreads), // degree of mt discovery |
2228 ParallelGCThreads, | 2228 false, // Reference discovery is not atomic |
2229 ParallelRefProcEnabled, | 2229 &_is_alive_closure, // is alive closure for efficiency |
2230 true); // Setting next fields of discovered | 2230 true); // Setting next fields of discovered |
2231 // lists requires a barrier. | 2231 // lists requires a barrier. |
2232 } | 2232 } |
2233 | 2233 |
2234 size_t G1CollectedHeap::capacity() const { | 2234 size_t G1CollectedHeap::capacity() const { |
2235 return _g1_committed.byte_size(); | 2235 return _g1_committed.byte_size(); |
2236 } | 2236 } |