HSSFWorkbook vs XSSFWorkbook and the advantages/disadvantages of XSSFWorkbook and SXSSFWorkbook?
Asked
Active
Viewed 6.3k times
24
-
Which file format are you trying to support, and how big are you files? Those'll make the biggest differences to which you want! – Gagravarr Oct 10 '15 at 10:52
-
1@Gagravarr, This question is for giving general information about WorkBook of Apache-Poi, because I saw that people don't know which one is suitable for their requirement. – Sedat Polat Oct 12 '15 at 08:56
1 Answers
36
A spreadsheet of each with as a summary of API features:

nbokmans
- 5,492
- 4
- 35
- 59
-
5"SXSSF is an API-compatible streaming extension of XSSF to be used when very large spreadsheets have to be produced, and heap space is limited. SXSSF achieves its low memory footprint by limiting access to the rows that are within a sliding window, while XSSF gives access to all rows in the document. Older rows that are no longer in the window become inaccessible, as they are written to the disk. " – Sedat Polat Oct 09 '15 at 22:14
-
1https://poi.apache.org/spreadsheet/eval.html For versions before 3.13 final, no formula evaluation is possible with SXSSF. If you are using POI 3.13 final or newer, formula evaluation is possible with SXSSF, but with some caveats. – martian Oct 12 '17 at 17:29
-
is there a comparison of memory footprints available (for various file sizes)? – Sachin Sharma Mar 28 '19 at 12:48
-
None that I know of but to give a real-world example: it reduced our (additional) memory consumption while creating a 300'000 row sheet (17 columns each) from ~3GB to ~0.5 GB. – mmo Mar 07 '23 at 12:43
-
What's missing in the comparison chart: the assignment of certain styles (in our case date-styles) does not work in the SXSSF-variant! Cells that are supposed to be displayed as dates-cells are displayed as integers :-( This may be a bug or a consciously missing feature - I did not find it mentioned anywhere in the docs (so I tend towards the bug...). Google searches revealed only a few similar issues but nothing helpful nor any work-arounds. – mmo Mar 07 '23 at 12:49