Yeah, our minimum requirement <https://source.android.com/setup/build/requirements> is 16GB (ignore the comment about virtual machines there -- the point is that we expect 16GB available for the OS+Build). Even on 16GB we've been seeing some number of issues (hence the workarounds I mentioned earlier).
You can try setting NINJA_HIGHMEM_NUM_JOBS=1 in your environment, you may also need to start lowering your `m -j#` value -- this defaults to a number related to your cpu cores, but that always doesn't work well on machines with low ram. (Anything we'd be doing to help the low ram cases would be adjusting these defaults based on what we detect we're running on) - Dan On Mon, Apr 6, 2020 at 1:11 PM Steve <[email protected]> wrote: > The machine has only 8Gb and 5580Mb are available when the build starts > for 'm api-stubs-docs'. Running a single job does not help. > This happens on the master branch. > > It is not a virtual machine, the available swap is 7300Mb which is the > default for Ubuntu installation. > > Too small? > > -Steve > > > > On Sunday, April 5, 2020 at 5:27:36 PM UTC+2, Steve wrote: >> >> Trying to build a standard AOSP on Ubuntu 14.04, target aosp_arm-eng. >> The build works fine until the metalava and the use of kotlin, when it >> fails with: >> >> WARNING: An illegal reflective access operation has occurred >>> WARNING: Illegal reflective access by >>> org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment >>> (file:/aosp/soong/host/linux-x86/framework/metalava.jar) to field >>> java.lang.reflect.Field.modifiers >>> WARNING: Please consider reporting this to the maintainers of >>> org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironment >>> WARNING: Use --illegal-access=warn to enable warnings of further illegal >>> reflective access operations >>> WARNING: All illegal access operations will be denied in a future release >>> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space >>> at >>> java.base/java.util.LinkedHashMap$LinkedKeySet.iterator(LinkedHashMap.java:543) >>> at java.base/java.util.HashSet.iterator(HashSet.java:173) >>> at >>> kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1220) >>> at kotlin.collections.ArraysKt___ArraysKt.distinct(_Arrays.kt:9836) >>> at >>> com.android.tools.metalava.model.psi.PsiModifierItem$Companion.create(PsiModifierItem.kt:188) >>> at >>> com.android.tools.metalava.model.psi.PsiModifierItem$Companion.create(PsiModifierItem.kt:58) >>> at >>> com.android.tools.metalava.model.psi.PsiItem$Companion.modifiers(PsiItem.kt:264) >>> at >>> com.android.tools.metalava.model.psi.PsiMethodItem$Companion.create(PsiMethodItem.kt:355) >>> at >>> com.android.tools.metalava.model.psi.PsiClassItem$Companion.create(PsiClassItem.kt:466) >>> at >>> com.android.tools.metalava.model.psi.PsiBasedCodebase.createClass(PsiBasedCodebase.kt:441) >>> at >>> com.android.tools.metalava.model.psi.PsiBasedCodebase.findOrCreateClass(PsiBasedCodebase.kt:559) >>> at >>> com.android.tools.metalava.model.psi.PsiClassItem$Companion$create$result$1.invoke(PsiClassItem.kt:534) >>> at >>> com.android.tools.metalava.model.psi.PsiClassItem$Companion$create$result$1.invoke(PsiClassItem.kt:391) >>> at >>> kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:172) >>> at >>> kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:716) >>> at >>> kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:746) >>> at >>> com.android.tools.metalava.model.psi.PsiClassItem$Companion.create(PsiClassItem.kt:538) >>> at >>> com.android.tools.metalava.model.psi.PsiBasedCodebase.createClass(PsiBasedCodebase.kt:441) >>> at >>> com.android.tools.metalava.model.psi.PsiBasedCodebase.initialize(PsiBasedCodebase.kt:180) >>> at com.android.tools.metalava.Driver.parseSources(Driver.kt:876) >>> at >>> com.android.tools.metalava.Driver.parseSources$default(Driver.kt:847) >>> at com.android.tools.metalava.Driver.loadFromSources(Driver.kt:773) >>> at com.android.tools.metalava.Driver.processFlags(Driver.kt:182) >>> at com.android.tools.metalava.Driver.run(Driver.kt:115) >>> at com.android.tools.metalava.Driver.run$default(Driver.kt:98) >>> at com.android.tools.metalava.Driver.main(Driver.kt:86) >>> 12:35:03 ninja failed with: exit status 1 >>> >>>> >>>> >> Following the AOSP environment instructions and build instructions, and >> have re-installed everything several times. Same problem with the latest >> version of Ubuntu and the LTS 14.04 version. Also with the aosp_arm64-eng >> target as well. >> >> Any suggestions? >> >> Steve >> >> -- > -- > You received this message because you are subscribed to the "Android > Building" mailing list. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-building?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "Android Building" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/android-building/10077ce0-eddf-49ca-a932-389cceeeec7a%40googlegroups.com > <https://groups.google.com/d/msgid/android-building/10077ce0-eddf-49ca-a932-389cceeeec7a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-building?hl=en --- You received this message because you are subscribed to the Google Groups "Android Building" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CALQgHdkf8dJQxWrg%3DLn%3DqOwEpwAkib2Me1KMfYKpFcyy1qq_kg%40mail.gmail.com.
