Created attachment 39390 [details] Proof-of-concept git diff of the change required to implement this feature SXSSFWorkbooks create temporary files to back the workbook on disk. To get rid of those temporary files, a user is required to explicitly call the SXSSFWorkbook#dispose method otherwise those temporary files will not be cleaned up. Workbooks are auto-closable so it would improve the developer experience if the SXSSFWorkbook#close method would call the SXSSFWorkbook#dispose method so that users don't need to always explicitly call SXSSFWorkbook#dispose. For example, if this were implemented a user using a try-with-resources statement like this would always ensure that the temporary files are cleaned up: try (Workbook wb = new SXSSFWorkbook()) { // create the sheets, rows, cells, etc. wb.write(oStream); } Attached is a git diff of this proposal with some accompanying Javadoc changes. It might also make sense to deprecate the SXSSFWorkbook#dispose method altogether and encourage users to just call SXSSFWorkbook#close but I didn't include that in the git diff.
I created a pull request on GitHub for this here: https://github.com/apache/poi/pull/586