TOMCAT运行时,实时监控当前应用JVM的使用情况;可以利用Tomcat自带的应用manager查看详情。
首先,确认服务目录webapps下有manager应用
其次,需要创建角色manager和对应的用户,修改/conf/tomcat-users.xml
1
2
3
4
5
6
7
8
9
10
|
<? xml version = '1.0' encoding = 'utf-8' ?> < tomcat-users > < role rolename = "tomcat" /> < role rolename = "role1" /> < role rolename = "manager-gui" /> < user username = "admin" password = "admin" roles = "manager-gui" /> < user username = "tomcat" password = "tomcat" roles = "tomcat" /> < user username = "both" password = "tomcat" roles = "tomcat,role1" /> < user username = "role1" password = "tomcat" roles = "role1" /> </ tomcat-users > |
然后,浏览器输入网址:http://IP:port/manager/status 帐号/密码:admin/admin登录
点击Server Status查看JVM内存使用情况
Free memory:当前可用的内存;
Total memory:当前已经分配的JVM内存;
Max memory:当前允许分配的最大JVM内存
完毕!
修改tomcat 最大内存,已分配内存,已分配内存中的剩余空间
C:\Tomcat\apache-tomcat-8.0.47\bin\catalina.bat
添加:set JAVA_OPTS=-Xms512m -Xmx768m
到此这篇关于Tomcat中查看JVM内存使用情况的文章就介绍到这了,更多相关Tomcat JVM内存内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!
原文链接:https://www.cnblogs.com/Fooo/p/15962775.html