Tomcat 服务器的 JVM 可用内存未返回给操作系统 [英] Tomcat server's JVM free memory not returned to OS

查看:44
本文介绍了Tomcat 服务器的 JVM 可用内存未返回给操作系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

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.

这篇关于Tomcat 服务器的 JVM 可用内存未返回给操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆