< prev index next >
src/share/vm/runtime/vm_version.cpp
Print this page
@@ -273,11 +273,12 @@
unsigned int Abstract_VM_Version::nof_parallel_worker_threads(
unsigned int num,
unsigned int den,
unsigned int switch_pt) {
if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
- assert(ParallelGCThreads == 0, "Default ParallelGCThreads is not 0");
+ assert(_parallel_worker_threads_initialized ||
+ ParallelGCThreads == 0, "Default ParallelGCThreads is not 0");
// For very large machines, there are diminishing returns
// for large numbers of worker threads. Instead of
// hogging the whole system, use a fraction of the workers for every
// processor after the first 8. For example, on a 72 cpu machine
// and a chosen fraction of 5/8
@@ -307,5 +308,17 @@
}
_parallel_worker_threads_initialized = true;
}
return _parallel_worker_threads;
}
+
+void Abstract_VM_Version::FinalParallelGCThreads_test() {
+ // This consistency check should only be made if the user has not set
+ // a value on the command line and a ergonomically determined value
+ // is used (i.e., _parallel_worker_threads_initialized is true).
+ if (FLAG_IS_DEFAULT(ParallelGCThreads) && _parallel_worker_threads_initialized) {
+ assert(ParallelGCThreads == VM_Version::calc_parallel_worker_threads(),
+ "ParallelGCThreads %u is different than that calculated after full VM initialization %u.",
+ ParallelGCThreads, VM_Version::calc_parallel_worker_threads());
+ }
+}
+
< prev index next >