Android 13PLEASE READ:
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/build.ninja is too large, which leads to out of memory.
huyuxin@nj-builder-01:~/missi_t_qcom/out$ cat combined-missi_phone_cn.ninja
builddir = out
depth = 31
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh build-missi_phone_cn.ninja
-rw-rw-r-- 1 huyuxin huyuxin 1.2G Sep 26 14:41 build-missi_phone_cn.ninja
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh build-missi_phone_cn-package.ninja
-rw-rw-r-- 1 huyuxin huyuxin 43K Sep 26 10:08 build-missi_phone_cn-package.ninja
huyuxin@nj-builder-01:~/missi_t_qcom/out$ ls -lh soong/build.ninja
-rw-rw-r-- 1 huyuxin huyuxin 22G Sep 26 14:36 soong/build.ninja
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)