Parallel build logic should work against available memory, not total memory

This commit is contained in:
derekwaynecarr 2015-11-16 15:09:39 -05:00
parent 47de06b1e2
commit a043f3c86e

View File

@ -415,12 +415,12 @@ kube::golang::build_binaries_for_platform() {
done
}
# Return approximate physical memory in gigabytes.
# Return approximate physical memory available in gigabytes.
kube::golang::get_physmem() {
local mem
# Linux, in kb
if mem=$(grep MemTotal /proc/meminfo | awk '{ print $2 }'); then
if mem=$(grep MemAvailable /proc/meminfo | awk '{ print $2 }'); then
echo $(( ${mem} / 1048576 ))
return
fi