[15]RFR: 8238356: CodeHeap::blob_count() overestimates the number of blobs
Rahul Raghavan
rahul.v.raghavan at oracle.com
Wed Feb 19 08:58:00 UTC 2020
Thank you Tobias.
Yes updated 'Affects Versions' in JBS.
(Issue seems to be present from JDK 9 onwards)
-Rahul
On 17/02/20 2:43 pm, Tobias Hartmann wrote:
> Hi Rahul,
>
> looks good to me. Please update the affected versions in the bug.
>
> Thanks,
> Tobias
>
> On 17.02.20 09:12, Rahul Raghavan wrote:
>> Hi,
>>
>> Please review the following fix changeset.
>>
>> <webrev> - http://cr.openjdk.java.net/~rraghavan/8238356/webrev.00/
>> <JBS> - https://bugs.openjdk.java.net/browse/JDK-8238356
>>
>> Issue reported - CodeHeap::blob_count() can miscalculate the blob count.
>> CodeHeap::_blob_count is only incremented, never decremented.
>>
>> Webrev fix proposal, same as suggested by Aleksey Shipilev,
>> is to decrement _blob_count on addition to the free list.
>>
>> [src/hotspot/share/memory/heap.cpp]
>> void CodeHeap::add_to_freelist(HeapBlock* a) {
>> FreeBlock* b = (FreeBlock*)a;
>> size_t bseg = segment_for(b);
>> _freelist_length++;
>>
>> + _blob_count--;
>> + assert(_blob_count >= 0, "sanity");
>> +
>> assert(b != _freelist, "cannot be removed twice");
>>
>> Found no issues with precheckin, tier1 - tier5 testing.
>>
>>
>> Thanks,
>> Rahul
More information about the hotspot-compiler-dev
mailing list