comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.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 3582bf76420e
children eda9eb483d29
comparison
equal deleted inserted replaced
2368:dde920245681 2369:92da084fefc9
1 /* 1 /*
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
825 void PSParallelCompact::post_initialize() { 825 void PSParallelCompact::post_initialize() {
826 ParallelScavengeHeap* heap = gc_heap(); 826 ParallelScavengeHeap* heap = gc_heap();
827 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); 827 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
828 828
829 MemRegion mr = heap->reserved_region(); 829 MemRegion mr = heap->reserved_region();
830 _ref_processor = ReferenceProcessor::create_ref_processor( 830 _ref_processor =
831 mr, // span 831 new ReferenceProcessor(mr, // span
832 true, // atomic_discovery 832 ParallelRefProcEnabled && (ParallelGCThreads > 1), // mt processing
833 true, // mt_discovery 833 (int) ParallelGCThreads, // mt processing degree
834 &_is_alive_closure, 834 true, // mt discovery
835 ParallelGCThreads, 835 (int) ParallelGCThreads, // mt discovery degree
836 ParallelRefProcEnabled); 836 true, // atomic_discovery
837 &_is_alive_closure, // non-header is alive closure
838 false); // write barrier for next field updates
837 _counters = new CollectorCounters("PSParallelCompact", 1); 839 _counters = new CollectorCounters("PSParallelCompact", 1);
838 840
839 // Initialize static fields in ParCompactionManager. 841 // Initialize static fields in ParCompactionManager.
840 ParCompactionManager::initialize(mark_bitmap()); 842 ParCompactionManager::initialize(mark_bitmap());
841 } 843 }