Skip to content

Reduce 32-bit zstdmt maximum job size to 256 MB - #4946

Open
kevinjzhang wants to merge 1 commit into
meta:devfrom
kevinjzhang:fix/zstdmt-32bit-jobsize-max
Open

kevinjzhang wants to merge 1 commit into
meta:devfrom
kevinjzhang:fix/zstdmt-32bit-jobsize-max

Conversation

@kevinjzhang

@kevinjzhang kevinjzhang commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

On 32-bit builds, a level 22 stream with nbWorkers=1 needs a 2 GiB round buffer (4 x 512 MB), which malloc cannot provide in a 32-bit address space, so compression fails with memory_allocation (#4628).

Lower ZSTDMT_JOBLOG_MAX from 29 to 28 and ZSTDMT_JOBSIZE_MAX from 512 MB to 256 MB on 32-bit builds, as such systems should not be using such resource intensive jobs anyway.

Notes:

  • On 32-bit, inputs larger than 256 MB are split into jobs at different points, so compressed bytes can differ for those configs. Output is still a valid zstd frame.
  • Related: Fix 32-bit zstdmt max job size allocation failure #4675 proposes the same cap change, but the tests are not necessary which just check the bounds match the architecture.

On 32-bit builds, a level 22 stream with nbWorkers=1 needs a 2 GiB
round buffer (4 x 512 MB), which malloc cannot provide in a 32-bit
address space, so compression fails with memory_allocation.

Lower ZSTDMT_JOBLOG_MAX from 29 to 28 and ZSTDMT_JOBSIZE_MAX from
512 MB to 256 MB on 32-bit builds, so the same case needs 1 GiB.
64-bit builds are unchanged.

Addresses meta#4628.
@meta-cla meta-cla Bot added the CLA Signed label Nov 12, 2026
@kevinjzhang
kevinjzhang requested a review from Cyan4973 November 12, 2026 23:04
@kevinjzhang
kevinjzhang marked this pull request as ready for review November 12, 2026 23:05

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant