I have an ECS Service that uses multiple tasks in order to execute a daily job. The memory that every task uses varies depending on the data it process. I have set to 16GB Ram in all my tasks but some tasks stopped with the following error "OutOfMemory".
Unfortunately, I can't break down the data that each task process because it has to be processed all together in order to produce the insights I want.
I know how to set up alarms for ECS Services for RAM and CPU. But RAM and CPU for the service refer to the Average of CPU and RAM for all tasks.
How can I set an alarm in order to trigger when a Task runs out of memory? Is there a suggested way to not encounter the OutOfMemory error ?