Limit cts-api-coverage parallelism to 8
cts-api-coverage is getting OOM killed in presubmit, likely due to
spawning a copy of dexdeps in parallel for every cpu in the system.
Limit it to 8 parallel subprocesses when running inside the build,
as other processes are likely already using cpu and memory.
Bug: 252817769
Test: m out/host/linux-x86/cts-api-coverage/system-api-coverage.html
Change-Id: Iaae6561ac173d32c1b5af895cab76f3f898da4bb
diff --git a/core/tasks/cts.mk b/core/tasks/cts.mk
index c282268..c8b1183 100644
--- a/core/tasks/cts.mk
+++ b/core/tasks/cts.mk
@@ -211,7 +211,7 @@
# 3 - Format of the report
define generate-coverage-report-cts
$(hide) mkdir -p $(dir $@)
- $(hide) $(PRIVATE_CTS_API_COVERAGE_EXE) -d $(PRIVATE_DEXDEPS_EXE) -a $(PRIVATE_API_XML_DESC) -n $(PRIVATE_NAPI_XML_DESC) -f $(3) -o $@ $(2)
+ $(hide) $(PRIVATE_CTS_API_COVERAGE_EXE) -j 8 -d $(PRIVATE_DEXDEPS_EXE) -a $(PRIVATE_API_XML_DESC) -n $(PRIVATE_NAPI_XML_DESC) -f $(3) -o $@ $(2)
@ echo $(1): file://$$(cd $(dir $@); pwd)/$(notdir $@)
endef