I am an Android developer. I am using CircleCi 2 for running tests. But between 27 and 29 of march I started to get OutOfMemmory Error.
All this issues appears only on emulator in Circle CI container, all works correctly on my local machine. Also I haven’t seen this issue before.
I know that Circle CI advertise to use Firebase Test Lab but I need to use emulator on Circle CI.
Maybe someone know what changed were did and how to solve it?
Are you using the Docker, Machine or OS X executor? I imagine your issue may be down to a change in the base OS - and that in turn depends on what executor you are using.
Righto. Have a look at the first step in your job output, where the Docker image is pulled. One of mine is like so:
Status: Downloaded newer image for docker/compose:1.20.1
using image docker/compose@sha256:f477b62c8634d15eee9c87b0dc2ea2d9f8f9246c97fbd187d4178dafaa11679a
The sha256 hash is like a “version” for the image. My thesis is that at the point your build broke, a new release for circleci/android:api-28 had been made, probably upstream from CircleCI. To fix this, find the hash for the last working build, and specify that, e.g.
That is not an ideal fix, as it does not resolve the error, but at least it will get your builds working again.
From there, I would advise you to fix the error properly. How you do that is up to you, but the core issue is obviously that you are running out of memory. Standard containers have 4G of RAM, which should be enough for most purposes. I would advise looking into adjusting the RAM requirements of Java, which can be set by switches.
However, if you really cannot optimise your build, then you can add a resource_class in your config for a larger container RAM limit (8G or 16G). You need to be on a paid plan for this, and I think you need to log a support ticket to enable the feature on your account.