< prev index next >

src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp

Print this page
rev 8068 : 6407976: GC worker number should be unsigned
Reviewed-by: jwilhelm

*** 1,7 **** /* ! * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 95,105 **** // Else // Calculate the number of GC threads based on the number of Java threads. // Calculate the number of GC threads based on the size of the heap. // Use the larger. ! int AdaptiveSizePolicy::calc_default_active_workers(uintx total_workers, const uintx min_workers, uintx active_workers, uintx application_workers) { // If the user has specifically set the number of // GC threads, use them. --- 95,105 ---- // Else // Calculate the number of GC threads based on the number of Java threads. // Calculate the number of GC threads based on the size of the heap. // Use the larger. ! uint AdaptiveSizePolicy::calc_default_active_workers(uintx total_workers, const uintx min_workers, uintx active_workers, uintx application_workers) { // If the user has specifically set the number of // GC threads, use them.
*** 176,196 **** } assert(new_active_workers > 0, "Always need at least 1"); return new_active_workers; } ! int AdaptiveSizePolicy::calc_active_workers(uintx total_workers, uintx active_workers, uintx application_workers) { // If the user has specifically set the number of // GC threads, use them. // If the user has turned off using a dynamic number of GC threads // or the users has requested a specific number, set the active // number of workers to all the workers. ! int new_active_workers; if (!UseDynamicNumberOfGCThreads || (!FLAG_IS_DEFAULT(ParallelGCThreads) && !ForceDynamicNumberOfGCThreads)) { new_active_workers = total_workers; } else { new_active_workers = calc_default_active_workers(total_workers, --- 176,196 ---- } assert(new_active_workers > 0, "Always need at least 1"); return new_active_workers; } ! uint AdaptiveSizePolicy::calc_active_workers(uintx total_workers, uintx active_workers, uintx application_workers) { // If the user has specifically set the number of // GC threads, use them. // If the user has turned off using a dynamic number of GC threads // or the users has requested a specific number, set the active // number of workers to all the workers. ! uint new_active_workers; if (!UseDynamicNumberOfGCThreads || (!FLAG_IS_DEFAULT(ParallelGCThreads) && !ForceDynamicNumberOfGCThreads)) { new_active_workers = total_workers; } else { new_active_workers = calc_default_active_workers(total_workers,
*** 200,217 **** } assert(new_active_workers > 0, "Always need at least 1"); return new_active_workers; } ! int AdaptiveSizePolicy::calc_active_conc_workers(uintx total_workers, uintx active_workers, uintx application_workers) { if (!UseDynamicNumberOfGCThreads || (!FLAG_IS_DEFAULT(ConcGCThreads) && !ForceDynamicNumberOfGCThreads)) { return ConcGCThreads; } else { ! int no_of_gc_threads = calc_default_active_workers( total_workers, 1, /* Minimum number of workers */ active_workers, application_workers); return no_of_gc_threads; --- 200,217 ---- } assert(new_active_workers > 0, "Always need at least 1"); return new_active_workers; } ! uint AdaptiveSizePolicy::calc_active_conc_workers(uintx total_workers, uintx active_workers, uintx application_workers) { if (!UseDynamicNumberOfGCThreads || (!FLAG_IS_DEFAULT(ConcGCThreads) && !ForceDynamicNumberOfGCThreads)) { return ConcGCThreads; } else { ! uint no_of_gc_threads = calc_default_active_workers( total_workers, 1, /* Minimum number of workers */ active_workers, application_workers); return no_of_gc_threads;
< prev index next >