Java - Flight Recorder with Tomcat on Windows
Tomcat as Windows Service
The following steps describe how to profile a running Tomcat/Java process where Tomcat has been setup as a Windows service; using Java Flight Recorder and Mission Control (requires JDK 7 or newer).
Preparation
- Open Tomcat’s Windows Service configuration helper: $TOMCAT_HOME\bin\Tomcat8w.exe
- Switch to the Java tab
- Append the following lines in order to enable flight recorder:
- Ensure the following lines are present as well in order to be able to connect over Mission Control. Adjust the same as needed:
- Click OK and restart Tomcat
Profiling
- Start Mission Control: $JAVA_HOME\bin\jmc.exe
- Click File > Connect
- Create a new connection
- Adjust the connection settings so they match the Tomcat JMX parameters
- Start flight recording (again, adjust the settings as needed and proceed)