Skip to content

cap JSON reader batches by bytes as well as value count - #7701

Merged
mattnibs merged 1 commit into
mainfrom
json-bytecap
Nov 23, 2026
Merged

mattnibs merged 1 commit into
mainfrom
json-bytecap

Conversation

@mattnibs

@mattnibs mattnibs commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

The JSON reader batched a fixed 10,240 values regardless of their size, so inputs with large values could produce batches hundreds of megabytes in size. This exhausts memory in constrained environments such as wasm.

Batches now end, by default, at 10,240 values or 16MB of raw input, whichever comes first, so small-value inputs batch as before while large-value inputs stay bounded. A batch always holds at least one value. Oversized batch buffers are no longer returned to the pool.

@mattnibs
mattnibs force-pushed the json-bytecap branch 2 times, most recently from 7db8d45 to a22ad12 Compare November 22, 2026 20:00
The JSON reader batched a fixed 10,240 values regardless of their
size, so inputs with large values could produce batches hundreds of
megabytes in size. This exhausts memory in constrained environments
such as wasm.

Batches now end, by default, at 10,240 values or 16MB of raw input,
whichever comes first, so small-value inputs batch as before while
large-value inputs stay bounded. A batch always holds at least one
value. Oversized batch buffers are no longer returned to the pool.
@mattnibs
mattnibs requested a review from a team November 22, 2026 20:08
@mattnibs
mattnibs merged commit 0b79e2b into main Nov 23, 2026
2 checks passed
@mattnibs
mattnibs deleted the json-bytecap branch November 23, 2026 01:02
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