Skip to content

Remove reference counting from size classed chunks (#16306)#16379

Merged
chrisvest merged 1 commit into
netty:4.1from
chrisvest:4.1-rm-refcnt-chunks
Feb 26, 2026
Merged

Remove reference counting from size classed chunks (#16306)#16379
chrisvest merged 1 commit into
netty:4.1from
chrisvest:4.1-rm-refcnt-chunks

Conversation

@chrisvest

Copy link
Copy Markdown
Member

Motivation:

SizeClassedChunk performs 2 atomic ops (retain/release) per allocation cycle on the hot path.

Modification:

Replace ref counting with a segment-count state machine that only needs atomics on the cold deallocation path.

Result:

No more per-allocation atomic operations for SizeClassedChunk.

(cherry picked from commit de25e7a)

Motivation:

SizeClassedChunk performs 2 atomic ops (retain/release) per allocation
cycle on the hot path.

Modification:

Replace ref counting with a segment-count state machine that only needs
atomics on the cold deallocation path.

Result:

No more per-allocation atomic operations for SizeClassedChunk.

(cherry picked from commit de25e7a)
@chrisvest chrisvest added this to the 4.1.132.Final milestone Feb 26, 2026
@chrisvest chrisvest enabled auto-merge (squash) February 26, 2026 18:09
@chrisvest chrisvest merged commit ebb66f9 into netty:4.1 Feb 26, 2026
18 checks passed
@chrisvest chrisvest deleted the 4.1-rm-refcnt-chunks branch February 27, 2026 23:19
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