From 5cc4844528d8e6fd91630c5d534f9e1f409c4283 Mon Sep 17 00:00:00 2001 From: Giuseppe Date: Wed, 8 Nov 2023 11:19:58 +0000 Subject: [PATCH] fix: memory leak in streaming excel processing --- jxls/src/main/java/org/jxls/area/XlsArea.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jxls/src/main/java/org/jxls/area/XlsArea.java b/jxls/src/main/java/org/jxls/area/XlsArea.java index 3e6e759b..0da33035 100644 --- a/jxls/src/main/java/org/jxls/area/XlsArea.java +++ b/jxls/src/main/java/org/jxls/area/XlsArea.java @@ -242,8 +242,10 @@ public Size applyAt(CellRef cellRef, Context context) { transformStaticCells(cellRef, context, commandsArea); fireAfterApplyEvent(cellRef, context); Size finalSize = new Size(cellRange.calculateWidth(), cellRange.calculateHeight()); - AreaRef newAreaRef = new AreaRef(cellRef, finalSize); - updateCellDataFinalAreaForFormulaCells(newAreaRef); + if (context.getConfig().isFormulaProcessingRequired()) { + AreaRef newAreaRef = new AreaRef(cellRef, finalSize); + updateCellDataFinalAreaForFormulaCells(newAreaRef); + } for (CommandData commandData : commandDataList) { commandData.resetStartCellAndSize(); }