I have a microservice in spring boot which is deployed in a container with corretto 11 in ECS.
The component is deployed with 512MB and its initial consumption is close to 50%, as traffic increases, memory increases and is never freed, to the point where the task in ECS crashes and a new one must be started.
The following image shows the behavior of memory over time, as the traffic increases the times in which the tasks in ECS are up are less.
Memory Consumption in a Container on AWS ECS
Spring Boot Version: 2.4.3 JDK Image: Corretto 11
UPDATE:
I did a profiler and analysis of the heapdump and I see a high consumption in spring libraries.