amazon-web-servicesamazon-ecs

OutOfMemoryError: Container killed due to memory usage on AWS batch job


I am using AWS ECS for for running a CI/CD job, but I am getting following error:

OutOfMemoryError: Container killed due to memory usage

The same job, when run with container on separate EC2, runs fine. How can I troubleshoot this?


Solution

  • Try to go through the following article by AWS: https://aws.amazon.com/premiumsupport/knowledge-center/ecs-resolve-outofmemory-errors/#:~:text=To%20troubleshoot%20OutOfMemory%20errors%20in,occur%20due%20to%20memory%20usage.

    I'd suggest looking into the latest changes after which this issue started (i am considering this used to work before).

    If this is the first time you are deploying this, i'd recommend providing more memory to the container.