Make totalMemory and freeMemory consistentWe were using different data sources for total and free physicalmemory on Linux and MacOS, which lead us to detect memory pressurewere there was in fact none, e.g. when running in containers withresource limits.We now get both total and available memory from the same OS specificdata source.
Less frequently used idle worker daemons memory based expirationLess frequently used idle worker daemons are expired when available system memory gets below a threshold.Expiration strategy is triggered both by memory sampling and when the build daemon is about to fork a new process, or a new worker daemon. It will attempt to free enough system memory to fit the new process below the threshold according to it's fork options.This implementation does an approximation on the amount of memory held by worker daemons, using their max heap setting instead of their committed memory. This will be fixed in subsequent changes.