Skip to content

Commit

Permalink
Fix unlimited memory.max not correctly detected from cgroups2 (#26)
Browse files Browse the repository at this point in the history
KNUTH-102242
  • Loading branch information
xcq1 committed Jul 2, 2024
1 parent fbc5e43 commit e4f5169
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fp_calc_to_int() {

CGROUPS_MEM_LIMIT_BYTES=$(cat /sys/fs/cgroup/memory.max /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null)

if [ "$CGROUPS_MEM_LIMIT_BYTES" = "9223372036854771712" ] || [ "X${CGROUPS_MEM_LIMIT_BYTES}X" = "XX" ]; then
if [ "$CGROUPS_MEM_LIMIT_BYTES" = "9223372036854771712" ] || [ "X${CGROUPS_MEM_LIMIT_BYTES}X" = "XX" ] || [ "${CGROUPS_MEM_LIMIT_BYTES}" = "max" ]; then
echo "There is no cgroups memory limit in place, falling back to default behavior (not setting any limit)."
CALCULATED_OPTS=""
else
Expand Down

0 comments on commit e4f5169

Please sign in to comment.