java.lang.outofmemory exception while reading excel file (xlsx) using POI

后端 未结 7 1906
死守一世寂寞
死守一世寂寞 2020-12-19 19:34

I am developing a web application which reads data from excel file (xlsx). I am using POI for reading excel sheet. The problem is when I try to read excel file, the server t

7条回答
  •  醉酒成梦
    2020-12-19 20:26

    I think you have to increase the size of the Heap. You can do it by editing the catalina.bat-file. Add -Xms1024m -Xmx1024m to the CATALINA_OPTS variable.

    • Xms = initial java heap size
    • Xmx = maximum java heap size

    EDIT: from Catalina.bat

    
    rem   CATALINA_OPTS   (Optional) Java runtime options used when the "start",
    rem                   "run" or "debug" command is executed.
    rem                   Include here and not in JAVA_OPTS all options, that should
    rem                   only be used by Tomcat itself, not by the stop process,
    rem                   the version command etc.
    rem                   Examples are heap size, GC logging, JMX ports etc.
    

提交回复
热议问题