태풍때문에 더운날이네요


남쪽의 뜨겁고 습한공기를 한껏 밀고 올라와 줘서, 낮에는 29도 요 아랫동네는 아예 폭염주의보도 뜨고, 난리도 아니군요. 그래도 태풍지나가는 자리는 아닌것에 감사해야겠죠. 남쪽에 계시는 분들 이번 태풍도 무사히 지나가길 기도해봅니다.

오늘 짧게 WSL2에서 AOSP를 한번더 빌드해보고 시간 비교해보려 합니다. 전에 16G제한은 Virtual Memory Paging파일로 커버가 되는 것을 확인했으니, 8G정도의 물리램에서도 커버가 가능한지 시험해보려합니다. 아마 초반부 Soong만 넘어가면. 컴파일단계에서는 코어가 많이 않은이상은 괜찮을 것 같거든요. 이전의 제약이었던. Java에서 쓰레드당 2G 사용하려던건, -j옵션으로 어떻게든 커버가 될 것 같고요.

기본 명령인 ‘m’ 만 썼을때의 결과는 Java Heap이 모자라서 실패이네요. 일단 Page쪽은 8G Ram에서도 16385M정도까지만 증가하고 어찌 넘어가는 모양이지만 컴파일 단에서 걸리는 것 같습니다. 그리고 부분 빌드일텐데 4시간이 걸리기도 했군요…

[ 93% 75961/81220] //frameworks/base:api-stubs-docs-non-updatable metalava merged [common]
FAILED: out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable-stubs.srcjar out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable_annotations.zip out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable_api.txt out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable_removed.txt out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api_lint_report.txt out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/check_last_released_api.timestamp out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/last_released_baseline.txt<br>out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava --manifest out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava.sbox.textproto --write-if-changed
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/49a7cc33d80847891abf538139e05268e1581b41<br>The failing command line can be found in<br>out/soong/.temp/sbox/49a7cc33d80847891abf538139e05268e1581b41/sbox_command.0.bash
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space<br>at com.intellij.psi.augment.PsiAugmentProvider$$Lambda$295/0x0000000100582c40.get$Lambda(Unknown Source)
at java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(DirectMethodHandle$Holder)
at java.base/java.lang.invoke.Invokers$Holder.linkToTargetMethod(Invokers$Holder)
at com.intellij.psi.augment.PsiAugmentProvider.collectAugments(PsiAugmentProvider.java:135)
at com.intellij.psi.impl.source.PsiModifierListImpl.getAnnotations(PsiModifierListImpl.java:294)
at com.intellij.psi.impl.source.tree.JavaSharedImplUtil.applyAnnotations(JavaSharedImplUtil.java:96)
at com.intellij.psi.impl.source.PsiTypeElementImpl.calculateType(PsiTypeElementImpl.java:149)
at com.intellij.psi.impl.source.PsiTypeElementImpl.lambda$getType$0(PsiTypeElementImpl.java:53)
at com.intellij.psi.impl.source.PsiTypeElementImpl$$Lambda$303/0x0000000100580c40.apply(Unknown Source)
at com.intellij.psi.util.CachedValuesManager.lambda$getProjectPsiDependentCache$0(CachedValuesManager.java:134)
at com.intellij.psi.util.CachedValuesManager$$Lambda$293/0x0000000100583040.compute(Unknown Source)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase$$Lambda$264/0x000000010054cc40.compute(Unknown Source)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)<br>at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase$$Lambda$263/0x000000010054c840.compute(Unknown Source)
at com.intellij.openapi.util.RecursionGuard$$Lambda$256/0x000000010054ec40.compute(Unknown Source)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:43)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)<br>at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
at com.intellij.psi.util.CachedValuesManager.getProjectPsiDependentCache(CachedValuesManager.java:132)
at com.intellij.psi.impl.source.PsiTypeElementImpl.getType(PsiTypeElementImpl.java:53)
at com.intellij.psi.impl.source.tree.JavaSharedImplUtil.getType(JavaSharedImplUtil.java:41)
at com.intellij.psi.impl.source.tree.JavaSharedImplUtil.getType(JavaSharedImplUtil.java:37)
at com.intellij.psi.impl.source.PsiMethodImpl.getReturnType(PsiMethodImpl.java:187)
at com.android.tools.metalava.model.psi.PsiMethodItem$Companion.create(PsiMethodItem.kt:386)
exit status 1
04:30:47 ninja failed with: exit status 1
failed to build some targets (04:19:51 (hh:mm:ss))

m -j4 옵션으로 강제 쓰레드 수를 줄여서 테스트해봅니다.

[ 12% 774/6033] //frameworks/base:module-lib-api-stubs-docs-non-updatable metalava merged [common]
FAILED: out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_report.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/check_last_released_api.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/last_released_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable-stubs.srcjar out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_annotations.zip out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_api.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_removed.txt
out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava --manifest out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava.sbox.textproto --write-if-changed
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4
The failing command line can be found in
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4/sbox_command.0.bash
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.base/java.util.Arrays.copyOf(Arrays.java:3793)
        at com.intellij.util.ArrayUtil.realloc(ArrayUtil.java:90)
        at com.intellij.lang.impl.TokenSequence$Builder.resizeLexemes(TokenSequence.java:162)
        at com.intellij.lang.impl.TokenSequence$Builder.performLexing(TokenSequence.java:125)
        at com.intellij.lang.impl.TokenSequence.performLexing(TokenSequence.java:69)
        at com.intellij.lang.impl.PsiBuilderImpl.performLexing(PsiBuilderImpl.java:188)
        at com.intellij.lang.impl.PsiBuilderImpl.<init>(PsiBuilderImpl.java:161)
        at com.intellij.lang.impl.PsiBuilderImpl.<init>(PsiBuilderImpl.java:115)
        at com.intellij.lang.impl.PsiBuilderFactoryImpl.createBuilder(PsiBuilderFactoryImpl.java:33)
        at com.intellij.lang.java.parser.JavaParserUtil.createBuilder(JavaParserUtil.java:169)
        at com.intellij.psi.impl.source.JavaFileElementType.parseContents(JavaFileElementType.java:73)
        at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$2(LazyParseableElement.java:175)
        at com.intellij.psi.impl.source.tree.LazyParseableElement$$Lambda$166/0x00000001004f7040.run(Unknown Source)
        at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:481)
        at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:174)
        at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:226)
        at com.intellij.psi.impl.source.tree.CompositeElement.countChildren(CompositeElement.java:415)
        at com.intellij.psi.impl.source.tree.CompositeElement.getChildrenAsPsiElements(CompositeElement.java:378)
        at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.getClasses(PsiJavaFileBaseImpl.java:74)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:270)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.access$findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:266)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClassInVirtualFile(KotlinCliJavaFileManagerImpl.kt:236)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:124)
        at org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade$CliFinder.findClass(KotlinJavaPsiFacade.java:492)
        at org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade.findClass(KotlinJavaPsiFacade.java:190)
        at org.jetbrains.kotlin.load.java.JavaClassFinderImpl.findClass(JavaClassFinderImpl.kt:44)
        at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope$classes$1.invoke(LazyJavaPackageScope.kt:76)
        at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope$classes$1.invoke(LazyJavaPackageScope.kt:54)
        at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:578)
        at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope.findClassifier(LazyJavaPackageScope.kt:142)
        at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope.getContributedClassifier(LazyJavaPackageScope.kt:132)
        at org.jetbrains.kotlin.load.java.lazy.descriptors.JvmPackageScope.getContributedClassifier(JvmPackageScope.kt:55)
exit status 1
exit status 1<br>06:26:39 ninja failed with: exit status 1
failed to build some targets (03:24 (mm:ss))

같은이유로 3분만에 탈락하네요. 근데 뭔가 시간이 이상합니다.

뭔가 미묘하게 다른 듯 같은 에러로 끝나는군요.

[ 3% 180/5439] //frameworks/base:module-lib-api-stubs-docs-non-updatable metalava merged [common]
FAILED: out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_report.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/check_last_released_api.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/last_released_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable-stubs.srcjar out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_annotations.zip out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_api.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_removed.txt<br>out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava --manifest out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava.sbox.textproto --write-if-changed
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4
The failing command line can be found in
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4/sbox_command.0.bash
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at it.unimi.dsi.fastutil.objects.ObjectArrayList.grow(ObjectArrayList.java:314)
at it.unimi.dsi.fastutil.objects.ObjectArrayList.add(ObjectArrayList.java:331)
at it.unimi.dsi.fastutil.objects.AbstractObjectList.push(AbstractObjectList.java:373)
at com.intellij.lang.impl.PsiBuilderImpl.prepareLightTree(PsiBuilderImpl.java:1008)
at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:897)
at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:892)
at com.intellij.psi.impl.source.tree.JavaElementType$ICodeBlockElementType.parseContents(JavaElementType.java:166)
at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$2(LazyParseableElement.java:175)
at com.intellij.psi.impl.source.tree.LazyParseableElement$$Lambda$166/0x00000001004f7040.run(Unknown Source)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:481)
at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:174)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:226)
at com.intellij.psi.impl.source.tree.LazyParseablePsiElement.getFirstChild(LazyParseablePsiElement.java:88)
at com.intellij.psi.impl.source.tree.LazyParseablePsiElement.acceptChildren(LazyParseablePsiElement.java:102)
at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:44)
at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:56)
at com.intellij.psi.impl.source.tree.java.PsiCodeBlockImpl.accept(PsiCodeBlockImpl.java:212)
at com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:80)
at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:44)
at com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:272)
at com.intellij.psi.JavaElementVisitor.visitBlockStatement(JavaElementVisitor.java:32)
at com.intellij.psi.impl.source.tree.java.PsiBlockStatementImpl.accept(PsiBlockStatementImpl.java:66)
at com.intellij.psi.impl.source.tree.LazyParseablePsiElement.acceptChildren(LazyParseablePsiElement.java:104)
at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:44)
at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:56)
at com.intellij.psi.impl.source.tree.java.PsiCodeBlockImpl.accept(PsiCodeBlockImpl.java:212)
at com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:80)
at com.intellij.psi.JavaRecursiveElementVisitor.visitElement(JavaRecursiveElementVisitor.java:44)
at com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:272)
at com.intellij.psi.JavaElementVisitor.visitSwitchStatement(JavaElementVisitor.java:288)
at com.intellij.psi.impl.source.tree.java.PsiSwitchStatementImpl.accept(PsiSwitchStatementImpl.java:52)
at com.intellij.psi.impl.source.tree.LazyParseablePsiElement.acceptChildren(LazyParseablePsiElement.java:104)
exit status 1
06:34:00 ninja failed with: exit status 1

예전에 확인했듯이, Java쪽 Max Heap사이즈가 j옵션 관계 없이 현재 코어수 * 2배수로 잡는게 계속 남아 있는 듯 합니다. 그래도 혹시 몰라. m -j1 까지 내려가 봅니다. 이제 바로 이번 에러 나온 후 다음 번에 같은 곳에서 걸려서 나오겠죠.. 만약 빌드 시스템에서 마음대로 Thread를 늘리는 게 아니라면.

첫 번째 히트입니다.

[ 0% 1/5260] //frameworks/base:module-lib-api-stubs-docs-non-updatable metalava merged [common]
FAILED: out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_report.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/check_last_released_api.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/last_released_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable-stubs.srcjar out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_annotations.zip out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_api.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_removed.txt
out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava --manifest out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava.sbox.textproto --write-if-changed
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4
The failing command line can be found in
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4/sbox_command.0.bash
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
exit status 1
06:54:03 ninja failed with: exit status 1

SWAP을 사용을 하려고 하지 않다가 터지는군요… 이 이상은 진행이 안되는 모양입니다. 이제 RAM을 10G로 늘려서 시도해봅니다.

[ 0% 1/5260] //frameworks/base:module-lib-api-stubs-docs-non-updatable metalava merged [common]
<br>FAILED: out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_report.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/check_last_released_api.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/last_released_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable-stubs.srcjar out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_annotations.zip out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_api.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_removed.txt<br>out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava --manifest out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava.sbox.textproto --write-if-changed
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4
The failing command line can be found in
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4/sbox_command.0.bash
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.intellij.psi.impl.source.tree.JavaASTFactory.createLeaf(JavaASTFactory.java:34)at com.intellij.lang.ASTFactory.leaf(ASTFactory.java:80)
at com.intellij.lang.impl.PsiBuilderImpl.createLeaf(PsiBuilderImpl.java:1722)
at com.intellij.lang.impl.PsiBuilderImpl.insertLeaves(PsiBuilderImpl.java:1250)
at com.intellij.lang.impl.PsiBuilderImpl.bind(PsiBuilderImpl.java:1199)
at com.intellij.lang.impl.PsiBuilderImpl.buildTree(PsiBuilderImpl.java:906)
at com.intellij.lang.impl.PsiBuilderImpl.getTreeBuilt(PsiBuilderImpl.java:892)
at com.intellij.psi.impl.source.JavaFileElementType.parseContents(JavaFileElementType.java:75)
at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$2(LazyParseableElement.java:175)
at com.intellij.psi.impl.source.tree.LazyParseableElement$$Lambda$166/0x00000001004f7040.run(Unknown Source)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:481)
at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:174)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:226)
at com.intellij.psi.impl.source.tree.CompositeElement.countChildren(CompositeElement.java:415)
at com.intellij.psi.impl.source.tree.CompositeElement.getChildrenAsPsiElements(CompositeElement.java:378)
at com.intellij.psi.impl.source.PsiJavaFileBaseImpl.getClasses(PsiJavaFileBaseImpl.java:74)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:270)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl$Companion.access$findClassInPsiFile(KotlinCliJavaFileManagerImpl.kt:266)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findPsiClassInVirtualFile(KotlinCliJavaFileManagerImpl.kt:236)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl.findClass(KotlinCliJavaFileManagerImpl.kt:124)
at org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade$CliFinder.findClass(KotlinJavaPsiFacade.java:492)
at org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade.findClass(KotlinJavaPsiFacade.java:190)
at org.jetbrains.kotlin.load.java.JavaClassFinderImpl.findClass(JavaClassFinderImpl.kt:44)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope$classes$1.invoke(LazyJavaPackageScope.kt:76)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope$classes$1.invoke(LazyJavaPackageScope.kt:54)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:578)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope.findClassifier(LazyJavaPackageScope.kt:142)
at org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageScope.getContributedClassifier(LazyJavaPackageScope.kt:132)
at org.jetbrains.kotlin.load.java.lazy.descriptors.JvmPackageScope.getContributedClassifier(JvmPackageScope.kt:55)
at org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope.getContributedClassifier(ChainedMemberScope.kt:35)
at org.jetbrains.kotlin.resolve.scopes.AbstractScopeAdapter.getContributedClassifier(AbstractScopeAdapter.kt:44)
at org.jetbrains.kotlin.resolve.lazy.ResolveSessionUtils.findClassByRelativePath(ResolveSessionUtils.java:88)exit status 1
06:58:09 ninja failed with: exit status 1

이제 WSL RAM을 10로 늘여서 시험해봅니다. – 실패

[  0% 1/5260] //frameworks/base:module-lib-api-stubs-docs-non-updatable metalava merged [common]
FAILED: out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/api_lint_report.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/check_last_released_api.timestamp out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/last_released_baseline.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable-stubs.srcjar out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_annotations.zip out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_api.txt out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava/module-lib-api-stubs-docs-non-updatable_removed.txt
out/host/linux-x86/bin/sbox --sandbox-path out/soong/.temp --output-dir out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava --manifest out/soong/.intermediates/frameworks/base/module-lib-api-stubs-docs-non-updatable/android_common/metalava.sbox.textproto --write-if-changed
The failing command was run inside an sbox sandbox in temporary directory
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4
The failing command line can be found in
out/soong/.temp/sbox/94ee1d5d0f8f74a52dd5f8aab9bb38f10d72e8d4/sbox_command.0.bash
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at com.intellij.util.containers.ConcurrentFactoryMap.createMap(ConcurrentFactoryMap.java:142)
        at com.intellij.util.containers.ConcurrentFactoryMap.<init>(ConcurrentFactoryMap.java:24)
        at com.intellij.util.containers.ConcurrentFactoryMap.<init>(ConcurrentFactoryMap.java:23)
        at com.intellij.util.containers.ConcurrentFactoryMap$2.<init>(ConcurrentFactoryMap.java:171)
        at com.intellij.util.containers.ConcurrentFactoryMap.createMap(ConcurrentFactoryMap.java:171)
        at com.intellij.codeInsight.AnnotationUtil.lambda$findNonCodeAnnotations$3(AnnotationUtil.java:133)
        at com.intellij.codeInsight.AnnotationUtil$$Lambda$298/0x0000000800589840.compute(Unknown Source)
        at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
        at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
        at com.intellij.util.CachedValueBase$$Lambda$264/0x000000080054cc40.compute(Unknown Source)
        at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
        at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
        at com.intellij.util.CachedValueBase$$Lambda$263/0x000000080054c840.compute(Unknown Source)
        at com.intellij.openapi.util.RecursionGuard$$Lambda$256/0x000000080054ec40.compute(Unknown Source)
        at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114)
        at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:43)
        at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
        at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
        at com.intellij.codeInsight.AnnotationUtil.findNonCodeAnnotations(AnnotationUtil.java:130)
        at com.intellij.codeInsight.AnnotationUtil.findAllAnnotations(AnnotationUtil.java:81)
        at com.intellij.codeInsight.AnnotationUtil.findAnnotation(AnnotationUtil.java:62)
        at com.intellij.codeInsight.AnnotationUtil.findAnnotation(AnnotationUtil.java:46)
        at com.intellij.codeInsight.AnnotationUtil.findAnnotation(AnnotationUtil.java:39)
        at com.intellij.psi.impl.PsiImplUtil.isDeprecatedByAnnotation(PsiImplUtil.java:438)
        at com.intellij.psi.stub.JavaStubImplUtil.isMemberDeprecated(JavaStubImplUtil.java:40)
        at com.intellij.psi.impl.source.PsiMethodImpl.isDeprecated(PsiMethodImpl.java:255)
        at com.android.tools.metalava.model.psi.PsiModifierItem$Companion.create(PsiModifierItem.kt:78)
exit status 1
07:16:59 ninja failed with: exit status 1
#### failed to build some targets (03:43 (mm:ss)) ####

12G RAM – 대략 9224M정도 RAM을 사용하다가 넘어가는게 보입니다. 10G는 왜 안된건지 –;;;

일단 8G RAM은 최소 사양 만족 못하는걸로 보이고요. 계속 모니터링 중인데 여러 스텝에서 8G넘어가는건 많이 보이고 있습니다. 빌드 후반부에 가서는 거의 12G RAM다 쓰고 8~9G 정도 Swap이 사용되는것도 보이네요. Java 쓰레드 4개정도가 거진 2기가 아래로 돌고 있고,. Javac하나는 3.1G까지도 사용하네요. 일단 부분 빌드는 성공했고. 11G로 낮춰서. Clean빌드 걸어봅니다.

[ 16% 838/5015] Install out/target/product/emulator_x86_64/apex/com.android.uwb/javalib/service-uwb.jar
8:58 //frameworks/base:api-stubs-docs-non-updatable metalava merged [common]
[100% 4616/4616] Create system-qemu.img now
removing out/target/product/emulator_x86_64/system-qemu.img.qcow2
updating out/target/product/emulator_x86_64/system-qemu.img ...
done

#### build completed successfully (01:33:28 (hh:mm:ss)) ####