RFR: 8200557: OopStorage parallel iteration scales poorly
Kim Barrett
kim.barrett at oracle.com
Thu May 3 19:28:00 UTC 2018
> On May 3, 2018, at 9:40 AM, Erik Österlund <erik.osterlund at oracle.com> wrote:
>>> And same here where a block array is created without retain reference counter, which is then incremented manually inside of replace_active_array. Seems to me like it would be easier to make BlockArray::create return already retained block arrays.
>> My experience with using refcounts has been that starting with an
>> implicit reference at construction time (e.g. initialize the refcount
>> to 1 at construction) is more often than not really not helpful.
>>
>> However, this comment led me to notice the constructor for OopStorage
>> should be checking the result of BlockArray::create.
>
> Okay. Having used Objective-C, which was explicitly reference counted, and by convention returned new objects with a ref count of 1, I am biased to think that is a good convention. Then you know that if you ever see a ref count of 0, it's because it should be deleted, and never because it either needs to be deleted or was just created. But that is just my opinion I guess, so I'm okay if you don't agree about that.
Dredging through old memories, I think the bad experiences I've had
with an initial refcount of 1 were related to working in an
environment with smart pointers and with exceptions. So I could be
convinced to reconsider this in a followup, if you want.
> Looks good.
Thanks.
More information about the hotspot-dev
mailing list