Skip to content

Add output buffer pooling - #1410

Merged
adwsingh merged 2 commits into
mainfrom
adwsingh/buffer-pooling-lifecycle
Oct 12, 2026
Merged

adwsingh merged 2 commits into
mainfrom
adwsingh/buffer-pooling-lifecycle

Conversation

@adwsingh

@adwsingh adwsingh commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What behavior changes?

Client serializers reuse output arrays, and the pipeline releases pooled request bodies after all retry attempts complete. Reads from a released pooled body throw an exception.

Why is this change needed?

This reduces allocations and copies during serialization while defining when transports and interceptors can safely retain request bodies.

How was this validated?

New tests cover buffer reuse, aliases, retries, timeouts, wrappers, and failed serialization. At the time of this update, Java 25 CI for Linux and macOS is still running.

What should reviewers focus on?

Check OutputBuffers.java, LeasedDataStream.java, and ClientPipeline.java for pool limits, alias copies, and release timing. Check transport timeout handling and wrappers for safe body reuse.

Additional Links

This PR has no additional links.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@adwsingh
adwsingh requested a review from mtdowling October 12, 2026 02:25
@adwsingh adwsingh added the perf Performance Optimization PRs label Oct 12, 2026
@adwsingh
adwsingh force-pushed the adwsingh/buffer-pooling-lifecycle branch from 3ae8adc to 641f796 Compare October 12, 2026 22:03
@adwsingh
adwsingh merged commit 304e025 into main Oct 12, 2026
2 of 3 checks passed
@adwsingh
adwsingh deleted the adwsingh/buffer-pooling-lifecycle branch October 12, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf Performance Optimization PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants