comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.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 78542e2b5e35
comparison
equal deleted inserted replaced
2368:dde920245681 2369:92da084fefc9
1 /* 1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 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.
56 jlong PSMarkSweep::_time_of_last_gc = 0; 56 jlong PSMarkSweep::_time_of_last_gc = 0;
57 CollectorCounters* PSMarkSweep::_counters = NULL; 57 CollectorCounters* PSMarkSweep::_counters = NULL;
58 58
59 void PSMarkSweep::initialize() { 59 void PSMarkSweep::initialize() {
60 MemRegion mr = Universe::heap()->reserved_region(); 60 MemRegion mr = Universe::heap()->reserved_region();
61 _ref_processor = new ReferenceProcessor(mr, 61 _ref_processor = new ReferenceProcessor(mr); // a vanilla ref proc
62 true, // atomic_discovery
63 false); // mt_discovery
64 _counters = new CollectorCounters("PSMarkSweep", 1); 62 _counters = new CollectorCounters("PSMarkSweep", 1);
65 } 63 }
66 64
67 // This method contains all heap specific policy for invoking mark sweep. 65 // This method contains all heap specific policy for invoking mark sweep.
68 // PSMarkSweep::invoke_no_policy() will only attempt to mark-sweep-compact 66 // PSMarkSweep::invoke_no_policy() will only attempt to mark-sweep-compact