Installation and use of Yourkit Java Profiler

  1. On the virtual machine, create a folder for, and download the Java Profiler, unzip it:
  2. 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
  3. Generate a script that allows you to use the Yourkit tool from a remote location
  4. 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
    
  5. Create a dummy location for Tomcat Logs while YJP is running
  6. mkdir /usr/share/tomcat6/logs
    chown tomcat6:adm /usr/share/tomcat6/logs
  7. Install the Yourkit tool itself on a Windows machine
  8. Stop Tomcat, attempt to start it using this new script
  9. /etc/init.d/tomcat6 stop
    su tomcat6
    /usr/share/tomcat6/bin/startup_with_yjp.sh
  10. It doesn't work -- Ubuntu's apt system installs a "bastardized" version of Tomcat that confuses the YourKit script