Getting Out of memory when reading large excel files (.xls) using Workbook method of apache poi jxl-2.6.jar

133 Views Asked by At
  1. File size is 10mb.

  2. File format is .xls

  3. I am using the Workbook class from jxl-2.6.jar file of apache poi.

    try {           
        Workbook wb = Workbook.getWorkbook(filePath);//**after this line i am getting OOM**
         sheet = wb.getSheet(sheetcount); // this line is even not executing.            
    } catch (Exception e) {
        // ...
    }
    

Please notice this is a .xls file, not a .xlsx file.

Any help is appreciated.

1

There are 1 best solutions below

1
On

May be you can try increasing the heap size and turning off GCC overhead with the command line flag -XX:-UseGCOverheadLimit. Also, -XX:MaxPermSize value can also be increased. Please provide stack trace as well.