|Summary:||Memory usage increase during writing Documents introduced in 4.0.0|
|Product:||POI||Reporter:||Dominik Stadler <dominik.stadler>|
|Component:||XSSF||Assignee:||POI Developers List <dev>|
|Bug Depends on:||62130|
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.