POI export Excel GC overhead limit exceeded

When using pio to export Excel, the amount of data is relatively large, about 300,000 pieces of data.

Using the method of sheet paging, each sheet page has 5000 entries.

But during the export process, an error GC overhead limit exceeded occurred.

This error, a large search on the Internet. The solutions all talk about changing the jvm size. Such as:

set JAVA_OPTS=-Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m 

Some say add -XX:-UseGCOverheadLimit.

Everyone has tested it, but it doesn't work. Very helpless.

I saw someone on the Internet saying that you can try it using SXSSFWorkbook. I took a look at the code and in the code is using:

Workbook workbook = new XSSFWorkbook();

Just give it a try. Change to Workbook workbook = new SXSSFWorkbook();

Sure enough, the effect is OK, no more errors. hereby record

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326110835&siteId=291194637