comparison src/share/vm/memory/generation.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 f95d63e2154a
children b632e80fc9dc
comparison
equal deleted inserted replaced
2368:dde920245681 2369:92da084fefc9
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
81 prev_used / K, used() / K, capacity() / K); 81 prev_used / K, used() / K, capacity() / K);
82 } 82 }
83 } 83 }
84 84
85 // By default we get a single threaded default reference processor; 85 // By default we get a single threaded default reference processor;
86 // generations needing multi-threaded refs discovery override this method. 86 // generations needing multi-threaded refs processing or discovery override this method.
87 void Generation::ref_processor_init() { 87 void Generation::ref_processor_init() {
88 assert(_ref_processor == NULL, "a reference processor already exists"); 88 assert(_ref_processor == NULL, "a reference processor already exists");
89 assert(!_reserved.is_empty(), "empty generation?"); 89 assert(!_reserved.is_empty(), "empty generation?");
90 _ref_processor = 90 _ref_processor = new ReferenceProcessor(_reserved); // a vanilla reference processor
91 new ReferenceProcessor(_reserved, // span
92 refs_discovery_is_atomic(), // atomic_discovery
93 refs_discovery_is_mt()); // mt_discovery
94 if (_ref_processor == NULL) { 91 if (_ref_processor == NULL) {
95 vm_exit_during_initialization("Could not allocate ReferenceProcessor object"); 92 vm_exit_during_initialization("Could not allocate ReferenceProcessor object");
96 } 93 }
97 } 94 }
98 95