What is the value for the cgroup's limit_in_bytes if the memory is not restricted/unlimited?

The value comes from the cgroup setup in the memory management layer; by default, it’s set to PAGE_COUNTER_MAX, which is LONG_MAX / PAGE_SIZE on 64-bit platforms, and multiplied by PAGE_SIZE again when read.

This confirms ilkkachu’s explanation: the value is the maximum 64-bit signed integer, rounded to the nearest page (by dropping the last bits).


That's the highest positive signed 64-bit integer (263-1), rounded down to multiples of 4096 (212), the most common page size on x86 systems. It would seem difficult to get anything higher while avoiding possible confusion between signed and unsigned, so it seems at least a reasonable approximation for infinity.

That said, I don't know for sure, this is just a guess.