summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorkrasin <krasin@google.com>2015-12-09 14:14:59 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-09 22:16:41 +0000
commit2d29f7386050b401838cfbb722a0f53fd1230fce (patch)
tree5300741c295fa7b51bdf85773941146546cf0ea7 /build
parent904e7a6af0105beb2c65c5a5744b746edf15da2a (diff)
downloadchromium_src-2d29f7386050b401838cfbb722a0f53fd1230fce.zip
chromium_src-2d29f7386050b401838cfbb722a0f53fd1230fce.tar.gz
chromium_src-2d29f7386050b401838cfbb722a0f53fd1230fce.tar.bz2
Give more RAM per ld process.
It has been observed that occasionally official buildbots would crash with OOM, when building Chrome with CFI (and thus with LTO). This CL reduces the number of concurrent link processes to avoid this problem. BUG=464797 Review URL: https://codereview.chromium.org/1509733004 Cr-Commit-Position: refs/heads/master@{#364173}
Diffstat (limited to 'build')
-rw-r--r--build/toolchain/get_concurrent_links.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/build/toolchain/get_concurrent_links.py b/build/toolchain/get_concurrent_links.py
index 32294fa..e72c12e 100644
--- a/build/toolchain/get_concurrent_links.py
+++ b/build/toolchain/get_concurrent_links.py
@@ -49,12 +49,14 @@ def _GetDefaultConcurrentLinks(is_lto):
match = memtotal_re.match(line)
if not match:
continue
+ mem_total_gb = float(match.group(1)) / (2 ** 20)
# Allow 8Gb per link on Linux because Gold is quite memory hungry
- # For LTO builds the RAM requirements are even higher
- # Note: it's 15 GB for LTO build to make sure we get 4 link jobs
- # for 64 GB, even if the system reports a couple of GBs less.
- ram_per_link_gb = 15 if is_lto else 8
- return max(1, int(match.group(1)) / (ram_per_link_gb * (2 ** 20)))
+ mem_per_link_gb = 8
+ if is_lto:
+ mem_total_gb -= 20 # Reserve
+ # For LTO builds the RAM requirements are even higher
+ mem_per_link_gb = 20
+ return int(max(1, mem_total_gb / mem_per_link_gb))
return 1
elif sys.platform == 'darwin':
try: