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:
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.