我的应用程序的垃圾收集器有问题,我正在使用Kubernetes和BigTable作为数据源的GCP环境中工作。
收到负载后,该应用程序不会释放内存空间,并且会填满,直到k8s重新启动POD。我使用探查器来查看JVM的行为,这就是结果。
在“旧一代”池中,可以看到内存已满,但是它从不释放空间,直到第一次重新启动后它才会填满。
在“ Eden Space”(伊甸园空间)游泳池中,可以看到它正在填充时释放了空间,从未达到极限。
This is the JVM configuration when creating the docker image to deploy it in k8s.
java
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseCGroupMemoryLimitForHeap
-XX:+AlwaysPreTouch
-XX:ParallelGCThreads=5
-XX:GCTimeRatio=4
-XX:MaxGCPauseMillis=100
-XX:MinHeapFreeRatio=30
-XX:MaxHeapFreeRatio=30
-Xms512m
-Xmx4608m
This same configuration is applied in another application that makes REST calls and has never had memory filling problems as in this case.
Java version is 1.8
Thankful for your help.
Grettings.
Firstly, you have to identify the root cause of your problem to proceed further. I would suggest you to collect more information on the topic with -XX:+PrintGCDetails and -XX:+PrintGCTimeStamps. If your hypothesis that "Old Gen" pool is never frees the space is correct (honestly spearking, it's not obvious from the image), you might apply few tricks to deal with it as such:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句