diff --git a/src/libraries/System.IO.Compression/tests/Zstandard/CompressionStreamUnitTests.Zstandard.cs b/src/libraries/System.IO.Compression/tests/Zstandard/CompressionStreamUnitTests.Zstandard.cs index 9c6c77f4f0b714..109574db7ef22c 100644 --- a/src/libraries/System.IO.Compression/tests/Zstandard/CompressionStreamUnitTests.Zstandard.cs +++ b/src/libraries/System.IO.Compression/tests/Zstandard/CompressionStreamUnitTests.Zstandard.cs @@ -17,11 +17,11 @@ public class ZstandardStreamUnitTests : CompressionStreamUnitTestBase public override Stream CreateStream(Stream stream, CompressionMode mode, bool leaveOpen) => new ZstandardStream(stream, mode, leaveOpen); public override Stream CreateStream(Stream stream, CompressionLevel level) { - if (PlatformDetection.Is32BitProcess && level == CompressionLevel.SmallestSize) + if ((PlatformDetection.Is32BitProcess || PlatformDetection.IsAppleMobile) && level == CompressionLevel.SmallestSize) { // Zstandard smallest size requires too much working memory // (800+ MB) and causes intermittent allocation errors on 32-bit - // processes in CI. + // processes and on memory-constrained Apple mobile devices (iOS/tvOS/MacCatalyst) in CI. level = CompressionLevel.Optimal; } @@ -29,11 +29,11 @@ public override Stream CreateStream(Stream stream, CompressionLevel level) } public override Stream CreateStream(Stream stream, CompressionLevel level, bool leaveOpen) { - if (PlatformDetection.Is32BitProcess && level == CompressionLevel.SmallestSize) + if ((PlatformDetection.Is32BitProcess || PlatformDetection.IsAppleMobile) && level == CompressionLevel.SmallestSize) { // Zstandard smallest size requires too much working memory // (800+ MB) and causes intermittent allocation errors on 32-bit - // processes in CI. + // processes and on memory-constrained Apple mobile devices (iOS/tvOS/MacCatalyst) in CI. level = CompressionLevel.Optimal; }