Confluence Docs 3.0 : Profiling using the YourKit Plugin
This page last changed on Mar 17, 2008 by smaddox.
There is a plugin for Confluence 2.2 and later which allows easy profiling using the YourKit profiler. No license is required to generate a memory or CPU snapshot, but you will need at least an evaluation license to analyse the results.
On this page: Configuring YourKit in your JVMDownload YourKit 6.0 for your platform and follow the installation instructions to install it. The following instructions apply to Confluence Standalone and Tomcat installations with Sun JDK 1.5. They should be easily applicable to other application servers and JVMs, however. The YourKit documentation covers this in more detail. Windows ConfigurationOn Windows, add to your PATH environment variable the bin/win32/ directory underneath the YourKit installation directory. For example, you might add "C:\Program Files\YourKit Java Profiler 6.0.12\bin\win32" to your PATH, via Control Panel, System, Advanced, Environment Variables. To configure Confluence's JVM to use the YourKit agent, you need to add a parameter to JAVA_OPTS in the bin/setenv.bat file in your Confluence application directory. This file controls the startup parameters for Tomcat, so you'll need to restart it after making the changes. Add the 'agentlib' parameter to the end like this: set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -agentlib:yjpagent Linux/Mac OS X ConfigurationOn Unix-based systems, include the installation directory in the library path environment variable, as shown below:
In general, to configure a Sun 1.5 JDK, you add the agentlib parameter: java -agentlib:yjpagent ... You can add this to Tomcat's bin/setenv.sh like this: JAVA_OPTS="-Xms128m -Xmx256m $JAVA_OPTS -Djava.awt.headless=true -agentlib:yjpagent " Performance ImpactRunning YourKit can have detrimental effects on performance. To minimize performance problems use the following modifications to the agentlib parameter: -agentlib:yjpagent=disablecounts,disablealloc,disablej2ee See also Profiling overhead: how to reduce or avoid in the YourKit documentation. Installing the YourKit PluginDownload the plugin and upload it into Confluence through the Administration, Plugins page. A new menu option will appear under the 'Administration' heading. Click it and you should see the options to take a memory or CPU snapshot.
This profiler dump will be saved to a local temp directory, and the path shown once it is complete. For the CPU snapshot, this will take at least 30 seconds. For the memory snapshot, 10-15 seconds.
Why would I do this?Analysing a profiler dump enables Atlassian Support (or you, if you are interested) to see exactly what is happening in your application: what classes are using the memory, what is using CPU and so on. This can help us debug tricky performance problems which would otherwise be impossible to analyse remotely. Take a CPU snapshot if:
Take a memory snapshot if:
-agentlib:yjpagent=onexit=memory Plugin Source CodeThe source code for this Confluence plugin is available from Subversion and browseable in Fisheye. The JAR produced by 'mvn package' includes a copy of the YJP redistributable bundled in META-INF/lib/. ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
Document generated by Confluence on Nov 05, 2009 23:36 |