I am using SXSSF to write 1 Million(worst case scenario) records.
Following is the way i have coded it.
I have to write the records to an already existing excel template. This
template is
available in the class path. I will copy this template to a common
location. Load this file using XSSFWorkBook.
SXSSFWorkbook is initialized with XSSFWorkBook and window size(-1) as
parameter.
when ever the record count reaches multiple of 100, i will flush the sheet.
Pseudo Code:
if(count % 100 == 0){
((SXSSFSheet)sheet).flush(100); //keeps only 100 rows in memory
}
But while executing this, heap memory is gradually increasing and it ends
up in Outofmemory exception. Maximum heap memory size of my machine is
about 1.5 GB.
Is it an expected behaviour? ie. is it expected to go beyond 1.5 GB while
writing record of size ~ 1 Million?
--
*RENJITH R*
9446011990