GC overhead limit exceeded with Apache POI

前端 未结 4 1611
粉色の甜心
粉色の甜心 2020-12-16 17:46

I have 13 .xlsx files with about 1000 rows in each of them. Now I want to merge it to one .xlsx file with one sheet. I\'m using code from here http://blog.sodhanalibrary.com

4条回答
  •  天命终不由人
    2020-12-16 18:32

    This issue occurs due to the below reason

    The java.lang.OutOfMemoryError: GC overhead limit exceeded error is the JVM’s way of signalling that your application spends too much time doing garbage collection with too little result. By default the JVM is configured to throw this error if it spends more than 98% of the total time doing GC and when after the GC only less than 2% of the heap is recovered.

    if you just want to neglect this issue you can set the following vm options:

    -XX:-UseGCOverheadLimit
    

    Refer link on GC overhead for more information.

    You can also use the below switches to assign more heap memory to your application. Run a pilot on your application for some time and identify how much memory would be better for your application

    -Xms128m -Xmx512m(these switches sets the initial heap memory size to 128mb and Max memory to 512mb)
    

提交回复
热议问题