From 8963fe4e41d6149032f8d54d67ff70962efb60db Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 16 Mar 2023 08:25:16 +0800 Subject: [PATCH] build: cmake: increase per link job mem to 4GiB lld is multi-threaded in some phases, based on observation, it could spawn up to 16 threads for each link job. and each job could take up to more than 3 GiB memory in total. without the change, we can run into OOM with a machine without abundant memory, so increase the per-link-job mem accordingly. Signed-off-by: Kefu Chai --- cmake/limit_jobs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/limit_jobs.cmake b/cmake/limit_jobs.cmake index 64b5624c3b..a51bf55a77 100644 --- a/cmake/limit_jobs.cmake +++ b/cmake/limit_jobs.cmake @@ -1,4 +1,4 @@ -set(LINK_MEM_PER_JOB 1024 CACHE INTERNAL "Maximum memory used by each link job in (in MiB)") +set(LINK_MEM_PER_JOB 4096 CACHE INTERNAL "Maximum memory used by each link job in (in MiB)") cmake_host_system_information( RESULT _total_mem