Open
Extend Zstandard SmallestSize test fallback to Apple mobile platforms#132701
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: rzikm <32671551+rzikm@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix OutOfMemoryException in ZstandardStreamUnitTests
Extend Zstandard SmallestSize test fallback to Apple mobile platforms
Aug 24, 2026
Contributor
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Zstandard test stream factory in System.IO.Compression tests to avoid using CompressionLevel.SmallestSize on platforms where it is known to require very large working memory, by downgrading it to CompressionLevel.Optimal when running on Apple mobile platforms (in addition to the existing 32-bit fallback).
Changes:
- Extend the existing
SmallestSize -> Optimalfallback to also apply onPlatformDetection.IsAppleMobile. - Apply the same fallback consistently across both
CreateStream(Stream, CompressionLevel)overloads. - Update the accompanying comment to document the Apple mobile rationale.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ZstandardStreamUnitTestsintermittently throwsOutOfMemoryExceptionon physical tvOS devices (~2 GB RAM) becauseCompressionLevel.SmallestSizemaps to Zstd's max-quality mode, which needs 800+ MB of working memory.Root cause
The test helper already downgrades
SmallestSize→Optimalfor 32-bit processes for the same memory reason, but the check didn't account for memory-constrained Apple mobile devices (iOS/tvOS/MacCatalyst).Fix
CompressionStreamUnitTests.Zstandard.csto also trigger whenPlatformDetection.IsAppleMobileis true, covering bothCreateStream(Stream, CompressionLevel)overrides.This is a test-only change; no product code is affected.