Tomcat turns on GC logs

Source: Internet
Author: User

Edit Modify the catlian.sh file to add the following information:

-XX:+PRINTGC//Turn on GC log monitoring-xx:+printgcdetails//You can learn more about the changes in the GC-xx:+printgctimestamps//You can see how long these garbage collections took place, measured in seconds since the JVM started-XX : +printgcdatestamps//GC Time information-XX:+PRINTHEAPATGC//Understanding Heap For more detailed information-xloggc:/opt/tomcat_8080/logs/gc.log

Example:

[email protected] ~]$ sudo vim/opt/tomcat_8080/bin/catalina.sh
Java_opts= "-xms1024m-xmx1024m-xx:permsize=512m-xx:maxpermsize=512m# Add the following:-xx:+printgc-xx:+printgcdetails-xx:+ Printgctimestamps-xx:+printgcdatestamps-xx:+printheapatgc-xloggc:/opt/tomcat_8080/logs/gc.log "
You will need to restart the TOMCA app after you modify it to take effect. Restart as follows: [[Email protected] ~]$ ll /opt/tomcat_8080/logs/gc.log-rw-r--r-- 1 root  root 506 Dec 16 13:15 /opt/tomcat_8080/logs/gc.log[[email protected]  ~]$ tailf /opt/tomcat_8080/logs/gc.log java hotspot (TM)  64-BIT SERVER VM   (25.60-B23)  for linux-amd64 JRE  (1.8.0_60-b27), built on aug   4 2015 12:19:40 by  "Java_re"  with gcc 4.3.0 20080428  (Red  hat 4.3.0-8) memory: 4k page, physical 8061236k (276644k free),  swap  0k (0k free) commandline flags: -xx:initialheapsize=1073741824 -xx:+managementserver  -xx:maxheapsize=1073741824 -xx:+printgc -xx:+printgcdatestamps -xx:+printgcdetails - Xx:+printgctimestamps -xx:+printheapatgc -xx:+usecompressedclasspointers -xx:+usecompressedoops &nbsP;-xx:+useparallelgc 



This article is from "Barley tea" blog, please be sure to keep this source http://damaicha.blog.51cto.com/6046098/1883305

Tomcat turns on GC logs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.