RFR: 8357959: (bf) ByteBuffer.allocateDirect initialization can result in large TTSP spikes [v2]

Rohitash Kumar duke at openjdk.org
Wed May 28 16:10:10 UTC 2025


On Wed, 28 May 2025 14:40:18 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Rohitash Kumar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   update license and stylistic improvements
>
> src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template line 119:
> 
>> 117: 
>> 118:         // Zero in chunks to avoid blocking safepoints for too long
>> 119:         long chunkSize = 1024 * 1024;
> 
> In the past, the bulk put/get when swapping also used 1MB as the threshold because of TTSP. So I think this value is reasonable. Might be a bit nicer to make it a constant (static final).

Thanks for the insight on value of chunk size. And agreed on static final part, I’ve made it a `private static final `constant

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25487#discussion_r2112268863


More information about the nio-dev mailing list