compose: Raise Paparazzi test worker heap to avoid OutOfMemoryError#6558
Conversation
The forked unit test worker that runs Paparazzi defaults to a 512 MB heap. recordPaparazziDebug renders and compresses every snapshot in that worker, which now exceeds 512 MB and fails with OutOfMemoryError. Set maxHeapSize to 4g on the compose module Test tasks so record and verify runs complete.
|
@CodeRabbit review |
✅ Action performedReview finished.
|
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
WalkthroughThe Gradle build script for stream-chat-android-compose is updated to configure all Test tasks with a maxHeapSize of "4g", accompanied by comments explaining the change relates to Paparazzi snapshot rendering memory requirements. ChangesGradle Test Heap Configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
SDK Size Comparison 📏
|
|
|
🚀 Available in v7.6.0 |



Goal
./gradlew :stream-chat-android-compose:recordPaparazziDebugfails withjava.lang.OutOfMemoryError: Java heap space. The same can happen onverifyPaparazziDebug.Paparazzi tests do not run in the Gradle daemon. They run in a forked unit test worker JVM, and that worker's heap is sized separately from the daemon. The compose module never sets a heap for the
Testtask, so the worker falls back to a 512 MB max heap. Passing-Dorg.gradle.jvmargs=-Xmx...on the command line does not help, because that only sizes the daemon, not the worker.The compose snapshot suite has grown (more tests and larger renders).
recordPaparazziDebugrenders and compresses every snapshot in that worker, and the peak usage now exceeds 512 MB, so it runs out of memory during PNG compression.Resolves AND-1299
Implementation
Set
maxHeapSize = "4g"on the compose moduleTesttasks:This is scoped to the compose module only, since it is the only module using the Paparazzi plugin and no other module has shown this issue.
Testing
develop, run./gradlew :stream-chat-android-compose:recordPaparazziDebug. It fails withOutOfMemoryErrorinApngWriter.compress.To confirm the worker heap without a full record run, you can check the effective value:
testDebugUnitTestworker reports a 512 MB max heap.