Created
July 18, 2020 13:25
-
-
Save mikecriggs/d98f2fc3461b23732fabebb020e4c42e to your computer and use it in GitHub Desktop.
Workarounds for building Android 10 on 8GB RAM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Workarounds for building Q on 8GB RAM environment: | |
1. At the start of the build: | |
[ 99% 138/139] /mnt/ssd/aosip/out/soong/.bootstrap/bin/soong_build /mnt/ssd/aosip/out/soong/build.ninja | |
This used to take around 30mins, after enabling zram now it takes around 30secs (thanks to @kdrag0n for the zram idea) which is on par with what happens in 16GB RAM building environments | |
sudo apt install zram-config for installing zram-config package | |
sudo nano /etc/fstab and add a # in front of the swap disk if you have one and then reboot | |
After booting cat /proc/swaps to check if zram is enabled or not | |
2. To avoid huge metalava compilation times, compile the api-stubs-docs and other packages manually first then continue with mka bacon etc | |
For example this is what I'm using now in aosip: | |
. build/envsetup.sh && lunch aosip_wayne-userdebug && mka api-stubs-docs && mka hiddenapi-lists-docs && mka system-api-stubs-docs && mka test-api-stubs-docs && mka kronic | |
Each of those api-stubs-docs, hiddenapi-lists-docs etc took around 4-7 mins | |
Increasing of heap from soong directory or other env exports are not required | |
Total combined build time in my system (Ryzen 1600 with a 8gb ddr4 stick) is around 2hrs now compared to 5hrs previously | |
For errors while building metalava check #metalava |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have found a few possibilities actually:
https://groups.google.com/g/android-building/c/5G2l5JR3jWE