Bug 63657 - Memory usage increase during writing Documents introduced in 4.0.0
Summary: Memory usage increase during writing Documents introduced in 4.0.0
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 4.0.0-FINAL
Hardware: All Linux
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on: 62130
  Show dependency tree
Reported: 2019-08-11 08:28 UTC by Dominik Stadler
Modified: 2019-08-12 18:43 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Stadler 2019-08-11 08:28:51 UTC
The changes for bug #62130 introduced a large memory increase due to the way Apache XMLBeans handles references to the CTCellImpl objects in XSSFRow/CTRowImpl and XSSFCell.

During writing a document, all CTCellImpl objects are now copied, while the CTRowImpl in XSSFRow still keeps a reference to the previous object, thus causing double memory usage until the XSSFWorkbook is removed from memory.
Comment 1 Dominik Stadler 2019-08-12 18:43:23 UTC
Fixed via r1864977, XMLBeans is quite hard to handle here, setCArray() does not set the passed objects, but rather populates existing ones if possible, so the code in XSSFRow.onDocumentWrite() actually duplicated all CTCellImpl objects and kept both until the XSSFWorkbook was freed up.