Skip to content

Allocate one large segment and slice for each MsgHdrMemory (#16234)#16251

Merged
normanmaurer merged 1 commit into5.0from
close5
Feb 11, 2026
Merged

Allocate one large segment and slice for each MsgHdrMemory (#16234)#16251
normanmaurer merged 1 commit into5.0from
close5

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

Motivation:

IoUringIoHandler.msgHdrMemoryArray has 1024 MsgHdrMemory instances, each allocating 4 CleanableDirectBuffers. On JDK 25, each clean() closes a shared Arena, so shutdown performs 1024 * 4 closeScope0 calls, i.e., excessive handshakes.

Modification:

Reimplement MsgHdrMemoryArray to allocate one large segment and slice for each MsgHdrMemory.
collapses 4096 shared closes into a single close.

Result:

Fixes #16174

Motivation:

IoUringIoHandler.msgHdrMemoryArray has 1024 MsgHdrMemory instances, each
allocating 4 CleanableDirectBuffers. On JDK 25, each clean() closes a
shared Arena, so shutdown performs 1024 * 4 closeScope0 calls, i.e.,
excessive handshakes.

Modification:

Reimplement MsgHdrMemoryArray to allocate one large segment and slice
for each MsgHdrMemory.
collapses 4096 shared closes into a single close.

Result:

Fixes #16174

---------

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Chris Vest <christianvest_hansen@apple.com>
@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Feb 10, 2026
@normanmaurer normanmaurer merged commit ebca4b9 into 5.0 Feb 11, 2026
13 checks passed
@normanmaurer normanmaurer deleted the close5 branch February 11, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants