https://bz.apache.org/bugzilla/show_bug.cgi?id=69322

--- Comment #4 from lwd <a96219...@gmail.com> ---
(In reply to PJ Fanning from comment #3)
> In ran the test case on my Macbook and it worked ok. No exceptions and wrote
> out the xlsx file. I made no modifications to the code to get it to work.

Sorry, a description of jvm parameters is missing.

I am testing the effect of useTempFilePackageParts=true on the jvm heap memory
usage, which works fine when the jvm parameter -Xmx1000M is set, and the above
error occurs when -Xmx100M is set.

And I noticed that it worked fine when the jvm parameter -Xmx1000M was set, But
by setting the TempFile as expected. SetTempFileCreationStrategy (new
DefaultTempFileCreationStrategy (tempDir)); The temporary files in the
specified temporary directory are not deleted correctly.

In my example I use var wb = new SXSSFWorkbook(1) to build a blank excel file,
and I end up calling this._wb = new XSSFWorkbook() to build a blank excel file.
In the method of new XSSFWorkbook () used in newPackage (XSSFWorkbookType
workbookType) method through UnsynchronizedByteArrayOutputStream constructs a
in the memory OPCPackage object.

I updated my example to add an OPCPackageTest class. In this class I first
create a blank excel file and then open it through SXSSFWorkbook and write the
relevant data.

github
address:https://github.com/a96219/TempFilePackagePartsError/blob/main/src/main/java/org/example/OPCPackageTest.java
Set the JVM parameter - Xmx100M then run org. Example. OPCPackageTest. The main
method. Ran successfully but did not clean up temporary files

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to