JDK8 Flight Recorder Configuration

Source: Internet
Author: User

JDK8 provides JMC tools, it should be worse than VISUALVM.

Post a Tomcat configuration, leave a backup of yourself and paste the following into Tomcat setenv.sh.

Nowday= 'Date+%y%m%d_%h%m%S ' Test-D: /gclogs | |mkdir.. /Gclogsif[-R"$CATALINA _base/bin/setenv_custom.sh"]; Then  . "$CATALINA _base/bin/setenv_custom.sh"elif[-R"$CATALINA _home/bin/setenv_custom.sh"]; Then  . "$CATALINA _home/bin/setenv_custom.sh"fiif[-Z $CATALINA _heap]; ThenCatalina_heap="-xms7g-xmx7g-xmn2g-xx:permsize=128m-xx:maxpermsize=128m"fiif[-Z $CATALINA _stack]; ThenCatalina_stack="-xss1m"fiif[-Z $CATALINA _GC]; Thencatalina_gc="-xx:maxtenuringthreshold=4-xx:+useconcmarksweepgc-xx:survivorratio=8-xx:cmsinitiatingoccupancyfraction=70- Xx:+explicitgcinvokesconcurrent"fiif[-Z $CATALINA _log]; ThenCatalina_log="-xx:-O mitstacktraceinfastthrow-xx:+printflagsfinal-xx:+printcommandlineflags-xx:+printgcdatestamps-xx:+ printtenuringdistribution-xx:+printgcdetails-xx:+printgctimestamps-xx:+printgcapplicationstoppedtime-xx:+ PRINTGCAPPLICATIONCONCURRENTTIME-XLOGGC:.. /gclogs/gc.log. $nowday"fiif[-Z $CATALINA _compiler]; ThenCatalina_compiler="-xx:cicompilercount=6"fiif[[!-Z"$JMX _port"&&! -Z "$JMX _host"]; ThenCatalina_extra="-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.port=${jmx_port}- Dcom.sun.management.jmxremote.ssl=false-djava.rmi.server.hostname=${jmx_host}- Dcom.sun.management.jmxremote.rmi.port=${jmx_port}"    if[[!-Z"$JMX _login"]]; Thenarr= (${jmx_login//:/ })jmx_user=${arr[0]} jmx_pass=${arr[1]}        Echo "$JMX _user readwrite Create com.sun.management.*,com.oracle.jrockit.* unregister">>.. /conf/jmxremote.accessEcho "$JMX _user $JMX _pass">>.. /conf/Jmxremote.passwordchmod  -.. /conf/jmxremote.access. /conf/Jmxremote.password Catalina_extra+="-dcom.sun.management.jmxremote.authenticate=true-dcom.sun.management.jmxremote.password.file=. /conf/jmxremote.password-dcom.sun.management.jmxremote.access.file=. /conf/jmxremote.access"    ElseCatalina_extra+="-dcom.sun.management.jmxremote.authenticate=false"    fifiif[[!-Z"$JFR"]]; ThenCatalina_extra+="-xx:+unlockcommercialfeatures-xx:+flightrecorder"fiif[-Z $CATALINA _opts]; Thencatalina_opts="$CATALINA _extra $CATALINA _heap $CATALINA _stack $CATALINA _gc-server $CATALINA _log $CATALINA _compiler"fijpda_address=8787Jpda_suspend=NEcho "using Catalina JVM Flags: $CATALINA _opts"

Variables in the script set environment variables can be, in fact, in order to docker-compose start convenient configuration

JDK8 Flight Recorder Configuration

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.