Spring Boot applications scale the number of pods in a Kubernetes cluster based on observed metrics: memory utilization, the JVM heap won't release once it grows or acquires the memory. So once we scale out, we won't be able to scale because the heap wil

Spring Boot applications scale the number of pods in a Kubernetes cluster based on observed metrics: memory utilization, the JVM heap won’t release once it grows or acquires the memory. So once we scale out, we won’t be able to scale because the heap will hold the memory; we need to run GC regularly. How do you handle this one? Please, can you help me?

Thanks
Sudhakar