diff options
author | Tim Besard <tim.besard@gmail.com> | 2023-05-12 20:34:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-12 14:34:20 -0400 |
commit | 6ad347fae4520f39520d34bd7c7f5ddafab13a69 (patch) | |
tree | 804c4054ab88b102949d3034431a131ed7e1cf8c /docs/src | |
parent | 748d894e82abcdfff7429cf745003e182c47f163 (diff) | |
download | libuv-6ad347fae4520f39520d34bd7c7f5ddafab13a69.tar.gz libuv-6ad347fae4520f39520d34bd7c7f5ddafab13a69.zip |
unix: constrained_memory should return UINT64_MAX (#3753)
Document that we return UINT64_MAX if the cgroup limit is set to the
max. For cgroupv2, that happens if we encounter `max`, while cgroupv1
returns 9223372036854771712 when no limit is set (which according to
[this StackExchange discussion] is derived from LONG_MAX and
PAGE_SIZE). So make sure we also detect this case for cgroupv1.
[this StackExchange discussion]: https://unix.stackexchange.com/questions/420906/what-is-the-value-for-the-cgroups-limit-in-bytes-if-the-memory-is-not-restricte
Addresses: https://github.com/libuv/libuv/pull/3744/files#r974062912
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/misc.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst index c2ad5804..8c3a00e9 100644 --- a/docs/src/misc.rst +++ b/docs/src/misc.rst @@ -586,8 +586,9 @@ API Gets the total amount of memory available to the process (in bytes) based on limits imposed by the OS. If there is no such constraint, or the constraint - is unknown, `0` is returned. Note that it is not unusual for this value to - be less than or greater than :c:func:`uv_get_total_memory`. + is unknown, `0` is returned. If there is a constraining mechanism, but there + is no constraint set, `UINT64_MAX` is returned. Note that it is not unusual + for this value to be less than or greater than :c:func:`uv_get_total_memory`. .. note:: This function currently only returns a non-zero value on Linux, based |