My application receives 10~ requests/milliseconds (10000 req/s), but sometimes I need to reload a file (30MB~) to the memory (hashMap) and after that the gc stops for 1s~ to collect the old hashMap. In this time, many requests received timeout because passed more than 1s waiting. I tried to increase the number of thread pools and tuning the XX:MaxGCPauseMillis. Is there any suggestion of what to do?
Infrastructure: Quarkus Reactive(Java 11) with G1GC JAVA_OPTIONS: -Xmx2g -Xms1.5g K8s pods 2gb/4gb in request/limits, 1c/2c request/limits
Implementation: each 1 hour the application reloads a csv file and recreates a singleton hashmap. The clients consume this hashmap at rate of 10 req/milliseconds.
update1: I tried to use ZGC instead G1 (-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:InitiatingHeapOccupancyPercent=70). My application reached the limit in CPU and memory (2c/4GB) and after sometime it fell due to OOM.