Add TotalRAM detection

Colin originally wrote this for the highmem pool:

https://android-review.googlesource.com/c/platform/build/soong/+/1168271

But while that's a larger change, this is useful to just be in the logs,
and for use in multiproduct_kati to better limit the number of
concurrent jobs.

Test: check soong.log on linux and mac
Change-Id: I0518d303a220d775f8d78dba9f660b2954e68e3e
This commit is contained in:
Dan Willemsen
2019-12-27 09:35:42 -08:00
parent fb1e5fbf13
commit 2bb82d0011
5 changed files with 80 additions and 0 deletions

View File

@@ -137,6 +137,7 @@ func help(ctx Context, config Config, what int) {
func Build(ctx Context, config Config, what int) {
ctx.Verboseln("Starting build with args:", config.Arguments())
ctx.Verboseln("Environment:", config.Environment().Environ())
ctx.Verbosef("Total RAM: %dGB", config.TotalRAM()/1024/1024/1024)
if config.SkipMake() {
ctx.Verboseln("Skipping Make/Kati as requested")