View JVM memory usage in tomcat6

TOMCAT can monitor the occupancy of the current application JVM in real time during the running process. The application manager brought by TOMCAT itself can monitor the server status. In order to run the program, the role manager and the corresponding user need to be created.

The creation location is in conf/tomcat-users.xml, and the content is as follows:

<?xml version='1.0' encoding='utf-8'?>                                                                     
<tomcat-users>                                                                                                             
  <role rolename="tomcat"/>                                                                                        
  <role rolename="role1"/>                                                                                          
  <role rolename="manager"/>                                                                                   
  <role rolename="admin"/>                                                                                        
  <user username="tomcat" password="tomcat" roles="tomcat"/>                    
  <user username="both" password="tomcat" roles="tomcat,role1"/>              
  <user username="role1" password="tomcat" roles="role1"/>                          
  <user username="admin" password="tomcat" roles="admin,manager"/>   
</tomcat-users>                                                                                                           

After creating the role manager and user admin/tomcat, you can use the manager application.

Type httpp://localhost:8080 in IE, enter the main interface of tomcat, and then select the left

Administration     
Under the Tomcat Manager , enter the user name and password (admin/tomcat), and enter the manager interface,

Select " Server Status " on the far right , and you can see the JVM occupancy.

Free memory: 3.69 MB Total memory: 10.60 MB Max memory: 63.31 MB

Free memory: currently available memory;

Total memory: the currently allocated JVM memory;

Max memory: The maximum JVM memory currently allowed to be allocated;

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326850221&siteId=291194637