From 36156dc87baa26abf78e5f1cef067602b20615f4 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Tue, 5 May 2015 23:51:10 +0000 Subject: [PATCH] OOM fix for gump run git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1677913 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xssf/usermodel/TestXSSFBugs.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 4fc0db1576..365ed2270c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -2463,7 +2463,17 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { c.setCellValue(i); } - wb = XSSFTestDataSamples.writeOutAndReadBack(wb); + // using temp file instead of ByteArrayOutputStream because of OOM in gump run + File tmp = TempFile.createTempFile("poi-test", ".bug57880"); + FileOutputStream fos = new FileOutputStream(tmp); + wb.write(fos); + fos.close(); + + wb.close(); + fmt = null; s = null; wb = null; + // System.gc(); + + wb = new XSSFWorkbook(tmp); fmt = wb.getCreationHelper().createDataFormat(); s = wb.getSheetAt(0); for (int i=1; i