mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8231779: crash HeapWord*ParallelScavengeHeap::failed_mem_allocate
Reviewed-by: dlong, tschatzl, pliden
This commit is contained in:
parent
398ce2948c
commit
edb6783a21
1 changed files with 5 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2020, 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
|
||||
|
@ -69,7 +69,8 @@ void ThreadLocalAllocBuffer::accumulate_and_reset_statistics(ThreadLocalAllocSta
|
|||
// The result can be larger than 1.0 due to direct to old allocations.
|
||||
// These allocations should ideally not be counted but since it is not possible
|
||||
// to filter them out here we just cap the fraction to be at most 1.0.
|
||||
double alloc_frac = MIN2(1.0, (double) allocated_since_last_gc / used);
|
||||
// Keep alloc_frac as float and not double to avoid the double to float conversion
|
||||
float alloc_frac = MIN2(1.0f, allocated_since_last_gc / (float) used);
|
||||
_allocation_fraction.sample(alloc_frac);
|
||||
}
|
||||
|
||||
|
@ -187,7 +188,8 @@ void ThreadLocalAllocBuffer::initialize() {
|
|||
set_desired_size(initial_desired_size());
|
||||
|
||||
size_t capacity = Universe::heap()->tlab_capacity(thread()) / HeapWordSize;
|
||||
double alloc_frac = desired_size() * target_refills() / (double) capacity;
|
||||
// Keep alloc_frac as float and not double to avoid the double to float conversion
|
||||
float alloc_frac = desired_size() * target_refills() / (float) capacity;
|
||||
_allocation_fraction.sample(alloc_frac);
|
||||
|
||||
set_refill_waste_limit(initial_refill_waste_limit());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue