Excessive HashMap with Xwork causes high CPU load
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Performance of Confluence is is slow.
Diagnosis
Long running threads in heap dumps show something similar to this:
"TP-Processor112" daemon prio=10 tid=0x0000002d9a661400 nid=0x58b3 runnable [0x000000004a9cf000..0x000000004a9d1d30]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at com.opensymphony.xwork.util.OgnlUtil.compile(OgnlUtil.java:192)
at com.opensymphony.xwork.util.OgnlUtil.setValue(OgnlUtil.java:188)
at com.opensymphony.xwork.util.OgnlValueStack.setValue(OgnlValueStack.java:113)
at com.opensymphony.xwork.util.OgnlValueStack.setValue(OgnlValueStack.java:97)
Cause
Due to CONF-17774, the xwork jar file bundled with Confluence itself can cause excessive HashMap.get operations.
Resolution
- Stop confluence:
- Move the <<confluence install>confluence/WEB-INF/lib/xwork-1.0.3.1.jar to a temporary backup directory (just in case we need to restore.
- Copy xwork-1.0.3.2.jar to <<confluence install>confluence/WEB-INF/lib/
(no need to rename file). - Start Confuence