Skip to content

Commit

Permalink
Support cgroups v2 (#25)
Browse files Browse the repository at this point in the history
KNUTH-101937
  • Loading branch information
xcq1 committed Jun 27, 2024
1 parent 6047e36 commit fbc5e43
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ fp_calc_to_int() {
fp_calc "$*" | xargs printf %.0f
}

CGROUPS_MEM_LIMIT_BYTES=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
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
echo "There is no cgroups memory limit in place, falling back to default behavior (not setting any limit)."
JAVA_XMX=""

CALCULATED_OPTS=""
else
CGROUPS_MEM_LIMIT_MIB=$(( $CGROUPS_MEM_LIMIT_BYTES / 1048576 ))
Expand Down

0 comments on commit fbc5e43

Please sign in to comment.