RFR: 8345374: Ubsan: runtime error: division by zeroavoid divide by zero
Kim Barrett
kbarrett at openjdk.org
Mon Dec 30 08:20:39 UTC 2024
On Mon, 30 Dec 2024 05:20:39 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> Please review this change to G1HeapSizingPolicy to avoid a float division by
>> zero when calculating the maximum desired capacity with a MaxHeapFreeRatio
>> value of 100%.
>>
>> Testing: mach5 tier1 with G1 and MaxHeapFreeRatio=100.
>
> src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp line 201:
>
>> 199:
>> 200: static size_t target_heap_capacity(size_t used_bytes, uintx free_ratio) {
>> 201: assert(free_ratio <= 100, "precondition");
>
> Doesn't debug.hpp have precond for this?
It does, and hardly anyone uses it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22893#discussion_r1899359181
More information about the hotspot-gc-dev
mailing list