I wanted to create excel(xlsx) report with 500000 records and hardly 10 cols.With jboss 512M and apache poi(3.9).
JVM got crashed with out of memory error as expected since poi usermodel has memory issues.
So I tried with SXSSFWorkbook by providing temp directory to flush rows to disk. The report got generated without any issue.
I am generating report on web application wherein i am writing workbbok to servlet OP stream.Will this cause any issue if multiple users tried to fetch report on same time since temp dir is shared by multiple threads.
I have also given call to dispose method of SXSSFWorkbook to cleanUp temp files, will it be safe since I doubt it should not delete temp files created by other threads(other user requests)
Also below code is safe ? Since I am disposing before closing output stream but after workbook is written to output stream.
workbook.write(out); workbook.dispose(); out.flush(); out.close();