Skip to content

Fix unintended high memory usage#4626

Merged
kevinjzhang merged 1 commit intofacebook:devfrom
kevinjzhang:fix-high-memory-usage
Mar 17, 2026
Merged

Fix unintended high memory usage#4626
kevinjzhang merged 1 commit intofacebook:devfrom
kevinjzhang:fix-high-memory-usage

Conversation

@kevinjzhang
Copy link
Contributor

@kevinjzhang kevinjzhang commented Mar 17, 2026

In particular parameter configurations of Zstd, a significantly larger value is used for hashLog than expected.
When hashLog == 0 and params->windowLog < params->hashRateLog, subtraction underflows and this results in using the maximum value for hashLog. This uses a large amount of memory in unintended scenarios.

Adds a unittest for this set of parameters and fixes the issue.

@meta-cla meta-cla bot added the CLA Signed label Mar 17, 2026
@kevinjzhang kevinjzhang force-pushed the fix-high-memory-usage branch from 1c8b8e1 to 63599c2 Compare March 17, 2026 20:08
@kevinjzhang kevinjzhang force-pushed the fix-high-memory-usage branch from 63599c2 to cef5a56 Compare March 17, 2026 20:11
@kevinjzhang kevinjzhang marked this pull request as ready for review March 17, 2026 20:14
@kevinjzhang kevinjzhang merged commit 3ae099b into facebook:dev Mar 17, 2026
105 checks passed
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.

2 participants