RFR: 8357959: (bf) ByteBuffer.allocateDirect initialization can result in large TTSP spikes [v2]
Aleksey Shipilev
shade at openjdk.org
Wed May 28 16:54:51 UTC 2025
On Wed, 28 May 2025 16:41:36 GMT, Oli Gillespie <ogillespie at openjdk.org> wrote:
>>> In the past, the bulk put/get when swapping also used 1MB as the threshold because of TTSP
>>
>> Oh, TIL. Do you have a pointer where that was? I searched around and cannot find it. We should probably put the constant in the similar place.
>
> We have https://github.com/openjdk/jdk8u/blob/master/jdk/src/share/classes/java/nio/Bits.java#L776-L779, at least. Not sure if there are others.
I see, so that copying threshold was removed by [JDK-8149596](https://bugs.openjdk.org/browse/JDK-8149596) in JDK 9: https://github.com/openjdk/jdk/commit/2255be0267ea036750587e2b9aef11e37d25eace
Which is extra confusing, because I don't think `Unsafe.copyMemory` is immune to TTSP issue as well.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25487#discussion_r2112345990
More information about the nio-dev
mailing list