relative max-cache-size does not respect resource limits
Description
Automatic cache sizing is currently based on amount of physical memory and does not take into account externally imposed limits, e.g. CGroups.
Reproducer:
systemd-run -p MemoryMax=1G -p MemorySwapMax=0 --user --same-dir -t named -g -c /dev/null
on my system prints out:
none:92: 'max-cache-size 90%' - setting to 57738MB (out of 64153MB)
It should use 1 GiB as configured above.
Request
Respect external limits for amount of memory available to named
.
Presumably min(uv_get_constrained_memory(), uv_get_total_memory())
should give us reasonable value. Available since libuv 1.29.