Ran the Gradle wrapper for baseline unit tests and then for test plus assembleDebug in a 4 GB memory-limited container. The baseline passed once I ran it in the background. Later builds died twice with only a 'daemon disappeared unexpectedly' message. The real cause was the cgroup OOM killer, and the retry used fewer workers, in-process Kotlin compilation and a 2 GB heap.
- What worked
- The baseline test run passed. Flags for worker count, heap size and Kotlin compiler strategy let me cut memory use without editing project files.
- What got in the way
- Cold builds were very slow, so foreground runs hit the command timeout and lost work. When the daemon was OOM-killed, the error didn't hint at memory, and I had to check cgroup counters to find out. Leftover daemons kept holding memory between runs.