The main out/soong/ file is too large, making localhost compilation difficult

Skip to first unread message

Yuxin Hu

Sep 28, 2022, 3:01:10 PMSep 28
to Android Building
Android 13


Our colleagues are developing on Android 13 and often encounter the problem of compilation process interruption during compilation。

soong_build process returns abnormally shortly after compilation

19:51:22 soong bootstrap failed with: exit status 1

The information that can be obtained by analyzing the `dmesg` log of the host is that the soong_build process was killed because of Out of memory. 

After analysis, we believe that one of the main reasons for this problem at the beginning of compilation is that out/soong/ is too large, which leads to out of memory.

huyuxin@nj-builder-01:~/missi_t_qcom/out$ cat

builddir = out
pool highmem_pool
 depth = 31
subninja out/
subninja out/
subninja out/soong/
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh
-rw-rw-r-- 1 huyuxin huyuxin 1.2G Sep 26 14:41
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh
-rw-rw-r-- 1 huyuxin huyuxin 43K Sep 26 10:08
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh soong/
-rw-rw-r-- 1 huyuxin huyuxin 22G Sep 26 14:36 soong/

On my host this file size is over 20 GB,My source code is from Qualcomm's distribution. The file may not be this large on the AOSP distribution.

Usually the memory on our developer's work host is not very rich, usually around 32GB.

Can we crop or split this file so that it can be easily compiled locally to verify some module issues? For example framework.jar services.jar Settings.apk etc.

(Our current workaround is to increase the size of the host's swap space, which results in a slow compilation process)

Thx !

Reply all
Reply to author
0 new messages