sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE) reports host-wide physical memory, ignoring cgroup limits. Inside containers, this causes GetTotalRAM() to return the full host RAM instead of what the process is actually allowed to use.
This PR caps the reported value with the cgroup memory limit by reading cgroup v2 (memory.max) or v1 (memory.limit_in_bytes) on Linux. When no limit is set, the host-wide value is kept unchanged.
It also helps with #34692 where dbcache defaults depend on detected system RAM.