https://bz.apache.org/bugzilla/show_bug.cgi?id=60723
Bug ID: 60723
Summary: Hyperlink Memory Leak
Product: POI
Version: 3.14-FINAL
Hardware: PC
Status: NEW
Severity: critical
Priority: P2
Component: SXSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
-When writing a million rows to excel, with each row having a hyper link, it
causes java to run out of memory. Heap space set to 4GB. write to excel without
hyper links ram usage was 160MB, with hyper links it used 4GB and crashed.
-Because a hyperlink object needs to be recreate every time in order for it to
work, it ends up eating ram. There doesn't seem to be a way to close hyperlink
objects after they are used.
-example code:
SXSSFWorkbook wb = new SXSSFWorkbook(100);
SXSSFSheet sheet = wb.createSheet();
CreationHelper createHelper = wb.getCreationHelper();
Hyperlink link;
SXSSFRow row;
SXSSFCell cell;
for(int i=0; i<1000000; i++){
row = sheet.createRow(i);
cell = row.createCell(1);
cell.setCellValue("Click Me");
link = createHelper.createHyperlink(Hyperlink.LINK_URL);
link.setAddress("http://yoururl.com");
cell.setHyperlink(link);
}
//then code to write to file.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]