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:
Download YourKit 6.0 for your platform and follow the installation instructions to install it.
Note: YourKit version 7 is not compatible with the Confluence yourkit plugin.
The following instructions apply to Confluence Standalone and Tomcat installations with the Oracle (previously Sun) JDK. They should be easily applicable to other application servers and JVMs, however. The YourKit documentation covers this in more detail.
Windows では、YourKit インストール ディレクトリの下の bin/win32/ ディレクトリの PATH 環境変数を追加します。たとえば、[コントロール パネル] > [システム] > [詳細] > [環境変数] 経由で、PATH に "C:\Program Files\YourKit Java Profiler 6.0.12\bin\win32" を追加することができます。
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.
末尾に、次のような 'agentlib' パラメーターを追加します。
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -agentlib:yjpagent |
Unix ベースのシステムでは、次のように、ライブラリパス環境変数にインストール ディレクトリが含まれます。
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/path/to/yourKitAgentexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/yourKitAgent一般に、JDK を設定するには、agentlib パラメーターを追加します。
java -agentlib:yjpagent ... |
これを、Tomcat の bin/setenv.sh に追加できます。例:
JAVA_OPTS="-Xms128m -Xmx256m $JAVA_OPTS -Djava.awt.headless=true -agentlib:yjpagent " |
YourKit の実行はパフォーマンスに影響を与える可能性があります。
パフォーマンスの問題を最小限に抑えるため、agentlib パラメーターで次の変更を使用します。
-agentlib:yjpagent=disablecounts,disablealloc,disablej2ee |
See also Profiling overhead: how to reduce or avoid in the YourKit documentation.
Download 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.

Screenshot above: YourKit Profiling menu item
このプロファイラー ダンプはローカルの一時ディレクトリに保存され、完了するとパスを示します。CPU スナップショットの場合は、30 秒以上かかります。メモリ スナップショットの場合は、10~15 秒かかります。

Screenshot above: You can take either a memory or CPU snapshot
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.
次の場合に CPU スナップショットを作成します。
次の場合にメモリ スナップショットを作成します。
If you run into situations where Confluence is unresponsive and you are not able to trigger a memory snapshot, please ensure that you start Confluence with the
onexit=memory parameter in the JVM options (as in the example below) and simply shut down Confluence. Before shutting down a memory snapshot will be created.
-agentlib:yjpagent=onexit=memory |
The 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/.