Tomcat server's JVM free memory not returned to OS

半腔热情 提交于 2020-01-01 19:53:20

问题


My tomcat server is behaving strange, it has allocated 6GB of memory from system, but more than 4GB is marked as "free".

This is a screen from tomcat server status:

I understand what "Free memory" in JVM means, but I do not understand why it is not returning lets say in this situation at least 3GB back to system.

Env:

  • Java 8
  • Tomcat 8
  • Debian 8.3
  • Total memory on machine: 64 GB

回答1:


Since you haven't overridden any JVM options, Tomcat uses the default garbage collector which is ParallelGC in JDK 8.

ParallelGC does not uncommit heap memory. Try -XX:+UseG1GC option. G1 garbage collector is capable of releasing memory back to the OS.

See this article for more information.



来源:https://stackoverflow.com/questions/52878059/tomcat-servers-jvm-free-memory-not-returned-to-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!