I am working on a Java 11 application which requires a lot of memory.
I have Elastic APM installed and when analyzing the metrics I see that the GC is pausing a lot causing timeouts in the application.
We are using the following GC config:
ENTRYPOINT ["java","-Xms17g","-Xmx17g","-XX:+UseParallelGC","-XX:ParallelGCThreads=5","-jar","/app.jar"]
The memory is almost 90% all the time.
After this GC pause, the heap memory dropped from 14.7gb to 10gb.
CPU went up to 90% (4 vCPU) and dropped after the gc pause.
The heap has an in-memory database H2.
What would be a way to avoid these long pauses?
Would increasing memory help?
Thanks,