Viewing pages with view Office macros causes system to hang prior to Confluence 3.3
Confluence pages with embedded office macros for large office 2007 xml based formats (eg. docx, xlsx, pptx) take a long time to load or the system becomes unresponsive. The document the view macro refers to is usually large in size (> 4mb).
Thread dumps of the server show one or many threads stuck in a running state:
"http-80-24" daemon prio=6 tid=0x5c689400 nid=0x7e8 runnable [0x655cb000..0x655cfa98\] java.lang.Thread.State: RUNNABLE at com.jxcell.util.CharBuffer.growSize(EYFN) ... at com.jxcell.View.Z(EYFN) at com.jxcell.View.getFormattedText(EYFN) at com.benryan.conversion.SpreadsheetConverter.writeHeaderStyles(SpreadsheetConverter.java:259) at com.benryan.conversion.SpreadsheetConverter.write(SpreadsheetConverter.java:75) at com.benryan.conversion.SpreadsheetConverter.convert(SpreadsheetConverter.java:413) at com.benryan.conversion.XlsConverter$1.doConversion(XlsConverter.java:53) at com.benryan.conversion.DocConverter.execute(DocConverter.java:53) at com.benryan.conversion.macro.ConverterMacro.execute(ConverterMacro.java:276) at com.atlassian.renderer.v2.macro.ResourceAwareMacroDecorator.execute(ResourceAwareMacroDecorator.java:51) ... at $Proxy58.convertWikiToXHtml(Unknown Source) at com.atlassian.confluence.pages.actions.ViewPageAction.execute(ViewPageAction.java:193)
The root cause is due to 3rd party library that Confluence uses to open and read the Office 2007 xml based files. The Office Connector attempts to build an object map of the file to display. Large office xml based files generate very large object maps for the plugin to process causing the large amounts of processing power (CPU) to be consumed. This causes the system to become unresponsive. The user notices the page takes a long time to load.
The following may resolve some of the symptoms:
Confluence must be restarted in order to terminate the currently running threads that are processing the view macro.
- Convert the document to binary office 2000/2003 format (eg. *.doc, *.xls), and refer to this in the view office macro.
- Temporarily disable the following items in Office Connector Plugin:
- *viewxls (disables viewxls macro)
- viewfile (this will still show the view link on the attachment page, but the resulting page after clicking the link will show a Unknown macro:
- Edit office document on attachment page (disables the the edit link).
Upgrade to version 3.3 or later. Track a permanent fix for this problem at CONF-19674.