- On the virtual machine, create a folder for, and download the Java Profiler, unzip it:
mkdir yourkit (this makes the folder in the root user's home directory)
cd yourkit
wget http://www.yourkit.com/download/yjp-8.0.19.zip
unzip yjp-8.0.19.zip
- Generate a script that allows you to use the Yourkit tool from a remote location
java -jar /root/yourkit/yjp-8.0.19/lib/yjp.jar -integrate
Choose server to integrate with:
1) Geronimo
2) JBoss 2.x/3.x/4.x
3) Jetty HTTP Server 5.x
4) JRun 4
5) Orion Application Server 1.5.x/2.x
6) Resin 2.x/3.x
7) Sun Application Server / GlassFish
8) Tomcat 3/4/5/6
9) WebLogic 9/10
10) WebSphere Application Server 6.1
11) Generic server (use if your server is not on the list)
Enter number which corresponds to your server (0 to exit) and press Enter:
>8
Location of Tomcat startup script (<TOMCAT_HOME>/bin/startup.sh):
>/usr/share/tomcat6/bin/startup.sh
Startup options configuration: step 1 of 4
Should option 'disablestacktelemetry' be specified?
1) Yes (recommended to minimize profiling overhead in production)
2) No
>1
Startup options configuration: step 2 of 4
Should option 'disableexceptiontelemetry' be specified?
1) Yes (recommended to minimize profiling overhead in production)
2) No
>1
Startup options configuration: step 3 of 4
Should option 'delay=10000' be specified?
1) Yes (recommended)
2) No
>1
Startup options configuration: step 4 of 4
Please specify comma-separated list of additional startup options, or press Enter for no additional options:
>
Startup script to be used for profiling has been successfully created:
/usr/share/tomcat6/bin/startup_with_yjp.sh
- Create a dummy location for Tomcat Logs while YJP is running
mkdir /usr/share/tomcat6/logs
chown tomcat6:adm /usr/share/tomcat6/logs
- Install the Yourkit tool itself on a Windows machine
- Stop Tomcat, attempt to start it using this new script
/etc/init.d/tomcat6 stop
su tomcat6
/usr/share/tomcat6/bin/startup_with_yjp.sh
- It doesn't work -- Ubuntu's apt system installs a "bastardized" version of Tomcat that confuses the YourKit script