詳解Tomcat中查看JVM內(nèi)存使用情況
TOMCAT運行時,實時監(jiān)控當前應用JVM的使用情況;可以利用Tomcat自帶的應用manager查看詳情。
首先,確認服務目錄webapps下有manager應用
其次,需要創(chuàng)建角色manager和對應的用戶,修改/conf/tomcat-users.xml
?<?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>??
然后,瀏覽器輸入網(wǎng)址:http://IP:port/manager/status 帳號/密碼:admin/admin登錄
點擊Server Status查看JVM內(nèi)存使用情況
Free memory:當前可用的內(nèi)存;
Total memory:當前已經(jīng)分配的JVM內(nèi)存;
Max memory:當前允許分配的最大JVM內(nèi)存
完畢!
修改tomcat 最大內(nèi)存,已分配內(nèi)存,已分配內(nèi)存中的剩余空間
C:\Tomcat\apache-tomcat-8.0.47\bin\catalina.bat
添加:set JAVA_OPTS=-Xms512m -Xmx768m
到此這篇關(guān)于Tomcat中查看JVM內(nèi)存使用情況的文章就介紹到這了,更多相關(guān)TomcatJVM內(nèi)存內(nèi)容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來源標注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務器上建立鏡像,否則將依法追究法律責任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學習參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。