mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
8000311: G1: ParallelGCThreads==0 broken
Divide by zero error, if ParallelGCThreads is 0, when adjusting the PLAB size. Reviewed-by: jmasa, jcoomes
This commit is contained in:
parent
3506d44c57
commit
ed98ea0a88
5 changed files with 30 additions and 31 deletions
|
@ -87,7 +87,7 @@ void ParGCAllocBuffer::flush_stats(PLABStats* stats) {
|
|||
// Compute desired plab size and latch result for later
|
||||
// use. This should be called once at the end of parallel
|
||||
// scavenge; it clears the sensor accumulators.
|
||||
void PLABStats::adjust_desired_plab_sz() {
|
||||
void PLABStats::adjust_desired_plab_sz(uint no_of_gc_workers) {
|
||||
assert(ResizePLAB, "Not set");
|
||||
if (_allocated == 0) {
|
||||
assert(_unused == 0,
|
||||
|
@ -107,7 +107,7 @@ void PLABStats::adjust_desired_plab_sz() {
|
|||
target_refills = 1;
|
||||
}
|
||||
_used = _allocated - _wasted - _unused;
|
||||
size_t plab_sz = _used/(target_refills*ParallelGCThreads);
|
||||
size_t plab_sz = _used/(target_refills*no_of_gc_workers);
|
||||
if (PrintPLAB) gclog_or_tty->print(" (plab_sz = %d ", plab_sz);
|
||||
// Take historical weighted average
|
||||
_filter.sample(plab_sz);
|
||||
|
|
|
@ -204,7 +204,8 @@ class PLABStats VALUE_OBJ_CLASS_SPEC {
|
|||
return _desired_plab_sz;
|
||||
}
|
||||
|
||||
void adjust_desired_plab_sz(); // filter computation, latches output to
|
||||
void adjust_desired_plab_sz(uint no_of_gc_workers);
|
||||
// filter computation, latches output to
|
||||
// _desired_plab_sz, clears sensor accumulators
|
||||
|
||||
void add_allocated(size_t v) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue