Skip to content

fix: CI Full Build 메모리 부족 문제 개선 - #960

Open
devfeijoa wants to merge 1 commit into
developfrom
fix/959
Open

fix: CI Full Build 메모리 부족 문제 개선#960
devfeijoa wants to merge 1 commit into
developfrom
fix/959

Conversation

@devfeijoa

@devfeijoa devfeijoa commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • Gradle Daemon의 최대 힙 크기를 2GB에서 4GB로 조정했습니다.
  • Gradle Metaspace의 최대 크기를 1GB로 제한했습니다.
  • Kotlin Daemon의 최대 힙 크기를 2GB로 설정했습니다.
  • Push CI의 Full Build와 Gradle 병렬 빌드 설정은 유지했습니다.

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

Push CI에서는 머지 후 전체 검증을 위해 ./gradlew build --scan을 실행하고 있습니다. 이 과정에서 debug lint, release lint, R8 축소 작업 등이 병렬로 수행될 때 기존 Gradle Daemon의 2GB 힙을 초과하여 Java heap space 오류가 발생했습니다.

PR CI의 작업 범위를 줄이거나 Push CI의 병렬 빌드를 비활성화하지 않고, Full Build의 검증 범위와 실행 방식을 유지하기 위해 JVM 메모리 설정을 조정했습니다.

org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8
kotlin.daemon.jvmargs=-Xmx2g

각 값은 프로세스가 즉시 점유하는 메모리가 아니라 사용할 수 있는 최대 한도입니다. Gradle Daemon은 최대 4GB 힙과 1GB Metaspace를 사용하고, 별도 프로세스인 Kotlin Daemon은 최대 2GB 힙을 사용하도록 제한했습니다.

검증 결과

로컬에서 Push CI와 동일한 명령을 실행했습니다.

./gradlew build --scan
  • BUILD SUCCESSFUL (17m 24s)
  • 1,775개 태스크 처리
  • 기존 실패 구간인 lintAnalyzeDebug, lintVitalAnalyzeRelease, minifyReleaseWithR8 통과
  • Git hook의 ktlintCheck, testDebugUnitTest, :app:assembleDebug 통과

Build Scan은 Gradle Terms of Use 미동의로 게시되지 않았지만, 빌드 자체는 정상 완료되었습니다.

Summary by CodeRabbit

  • 개선 사항
    • 대규모 프로젝트 빌드 작업에서 사용할 수 있는 메모리 용량을 조정해 빌드 안정성과 처리 성능을 개선했습니다.
    • Kotlin 관련 빌드 작업의 메모리 사용량도 함께 최적화했습니다.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 7af4c0a3-a31e-4ad9-b421-13cefbd3ac3d

📥 Commits

Reviewing files that changed from the base of the PR and between 0b9c481 and d4d2cb2.

📒 Files selected for processing (1)
  • gradle.properties

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Gradle 데몬의 힙과 메타스페이스 한도를 확장했습니다. Kotlin 데몬에 2g 힙 설정을 추가했습니다.

Changes

CI 빌드 메모리 설정

Layer / File(s) Summary
데몬 JVM 메모리 한도 설정
gradle.properties
Gradle 데몬 힙을 4g로 설정하고 메타스페이스 한도를 1g로 추가했습니다. Kotlin 데몬 힙을 2g로 설정했습니다.

Estimated code review effort: 1 (Trivial) | ~2분

Merge Risk: 🔵 Low · up to d4d2c

CI builds can now allow substantially more memory across Gradle and Kotlin processes, which may increase the chance of runner-level memory pressure when parallel work is active. The change is mergeable with explicit owner awareness to confirm the aggregate memory budget.

Poem

토끼가 메모리 문을 활짝 열고
Gradle 데몬이 힘차게 뛰네
Kotlin 데몬도 당근을 받아
넉넉한 힙에서 빌드를 하네
CI 숲에 오류가 잦아드네

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 CI Full Build의 메모리 부족 문제를 개선하는 주요 변경 사항을 명확하게 설명합니다.
Description check ✅ Passed 필수 섹션과 이슈 번호가 포함되어 있습니다. 변경 내용과 검증 결과도 구체적으로 설명되어 있습니다. 스크린샷과 리뷰어 메모는 비어 있지만 비핵심 항목이므로 설명 요건을 충족합니다.
Linked Issues check ✅ Passed 변경 사항은 연결된 이슈 [#959]의 CI Full Build 메모리 부족 문제 개선 목적과 일치합니다. Gradle Daemon 및 Kotlin Daemon의 메모리 설정을 조정하고 Full Build 및 병렬 빌드 설정을 유지했습니다.
Out of Scope Changes check ✅ Passed 변경 사항은 gradle.properties의 JVM 메모리 설정에 한정됩니다. 연결된 이슈 [#959]와 무관한 코드 변경이나 설정 변경은 확인되지 않습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/959

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: CI Full Build 메모리 부족 문제 개선

2 participants