facebook / facebook/zstd

cli-tests: levels.sh --max test fails on systems with < 10GB RAM

Open
#4,748 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
27.9k
Forks
2.6k
Avg merge
1d 3h
Merged PRs (30d)
8

Description

The compression/levels.sh cli-test unconditionally runs `zstd --max` on
64-bit systems, which allocates ~8.5GB. This fails on systems with less
than 10GB RAM (e.g. virtual machines, CI containers, embedded test
environments).

The test already handles the 32-bit case by skipping --max:

if echo "$version_info" | grep -q '32-bit'; then
# skip --max test: not enough address space
cp file-19.zst file-max.zst

A similar check for available memory would allow the rest of the test
(default levels, clamping, environment variables) to run on
memory-constrained systems:

if echo "$version_info" | grep -q '32-bit' || [ "$(awk '/MemTotal/{print $2}' /proc/meminfo)" -lt 10000000 ]; then
# skip --max test: not enough address space or memory (<10GB)
cp file-19.zst file-max.zst

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.