java.lang.OutOfMemoryError: Java heap space while reading excel with Apache POI

前端 未结 6 1493
渐次进展
渐次进展 2020-12-01 06:46

My file is 9MB and I got this error while loading workbook.

XSSFWorkbook workbook = new XSSFWorkbook(excelFilePath); 

this

6条回答
  •  旧时难觅i
    2020-12-01 07:13

    Increase the heap size as such:

    -Xms256m -Xmx512m -XX:PermSize=64M -XX:MaxPermSize=1000M

    These values should be provided to the VM.

    Take a look at the link to, this should help you out

    http://www.javabeat.net/tips/192-javalangoutofmemoryerror-java-heap-space.html

提交回复
热议问题