App containers have no memory

Hello,

I’m running the command free -m when I start my tests, and after they are finished to see how is the memory affected by my code.

However, we see that there is an issue regarding the container that executes our tests. What happens is that the free memory available when the tests start is very little, and our tests are never finished.

Here’s a screenshot of the memory available at bootup:

What we expect

We expect the container to have some free memory for us to use. In fact, we are testing a little React app with jest and we don’t expect the memory to be impacted heavily by these tests. However, as I said before, they are never finished because the instance goes out of memory.

I don’t know what the practical impact of that free output is, but perhaps can you show the console output when running your tests? Is there an error? Machines by default have 4G of RAM, which is a fair amount!

Thank you,

The output of the free command lets me know how much memory is left (see the link below) for the process to run. What I think is that maybe my container is running in a much larger computer, because the free -m command is supposed to output the free memory in MB, and it displays something like 60GB.

However, I see that the machine has about 7GB free, and my tests never end.

Links:

  1. Memory usage: https://www.cyberciti.biz/faq/linux-check-memory-usage/

Solution:

I am posting the solution because it was something awkward.
I am developing with NodeJS 6+, and I have installed Jest for testing, in its version ^22.1.4. After those tests, I was outputting the coverage of my code, wich in Jest it is done by adding "collectCoverage": true in the package.json file.

It seems to be a bug related to Jest, because as soon as I disabled the coverage (jest --no-coverage) everything went fine.

I confirm that everything works ok now.

1 Like

Great! Is it worth filing a bug report with the Jest project?

I should say that test infrastructure with 60G of RAM is extremely rare, and an expensive way to run tests. As far as I know, the largest machine Circle do is 8G, and it sounds like that’s what you have already.

I’m on 4G and may try to downgrade to 2G at some point!