Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(943)

Unified Diff: build/toolchain/get_concurrent_links.py

Issue 1509733004: Give more RAM per ld process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reserve 20 GB for spikes Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/get_concurrent_links.py
diff --git a/build/toolchain/get_concurrent_links.py b/build/toolchain/get_concurrent_links.py
index 32294fab849d242298f447557cab6d710208c737..e72c12ec42a6ecc3416eda6a9f928510dab0b571 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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698