简体   繁体   English

java.lang.OutOfMemoryError:超出GC开销限制,通过Apache POI读取启用宏的Excel工作表时出错

[英]java.lang.OutOfMemoryError: GC overhead limit exceeded Error while Reading Macro enabled excel sheet through Apache POI

I have a Macro Enabled Excel file in XLSM format . 我有XLSM格式Macro Enabled Excel文件 Inside this excel, 2-3 dependent dropdowns are there. 在此excel内部,有2-3个依赖的下拉菜单。 I have written a macro code to stop delete for a particular column. 我已经编写了一个宏代码来停止删除特定列。

I am uploading this excel using the following code. 我正在使用以下代码上传此excel。

 XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(fileName)); XSSFSheet sheet = workbook.getSheetAt(1); XSSFRow row; XSSFCell cell; int rows = sheet.getPhysicalNumberOfRows(); 

But it is giving a ERROR: 但是它给出了一个错误:

 java.lang.OutOfMemoryError: GC overhead limit exceeded com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl.getNodeObject (DeferredDocumentImpl.java:972) com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl.synchronizeD ata(DeferredElementNSImpl.java:126) com.sun.org.apache.xerces.internal.dom.ElementNSImpl.getNamespaceURI(Elem entNSImpl.java:250) 

While Uploading without macro, there is no error and working fine. 在没有宏的情况下上传时,没有错误并且工作正常。

java.lang.OutOfMemoryError: GC overhead limit exceeded : This error comes when GC is unable to freeup objects in continuous cycles. java.lang.OutOfMemoryError:超出了GC开销限制:当GC无法连续释放对象时,将出现此错误。 You can specify the limit in vm startup arguments. 您可以在虚拟机启动参数中指定限制。

This means with Macro on your references beocme strong and are not eligible for GC . 这意味着在您的引用上使用Macro会变得非常强大,并且不符合使用GC的资格。 The same objects in the absence of Macro are eligible for GC. 缺少Macro的相同对象有资格使用GC。

You need to look into as why on addding Macro , references are becoming reachable. 您需要研究一下为什么在添加Macro时引用变得可访问。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.OutOfMemoryError:使用Apache POI读取Excel文件时,超出了GC开销限制 - java.lang.OutOfMemoryError: GC overhead limit exceeded" while reading excel file using apache POI Java-Apache poi导致java.lang.OutOfMemoryError:超出了GC开销限制 - Java - Apache poi leads to java.lang.OutOfMemoryError: GC overhead limit exceeded Apache POI autoColumnWidth java.lang.OutOfMemoryError:超出GC开销限制 - Apache POI autoColumnWidth java.lang.OutOfMemoryError: GC overhead limit exceeded java.lang.OutOfMemoryError:GC开销限制超出了excel阅读器 - java.lang.OutOfMemoryError: GC overhead limit exceeded excel reader 获取错误:java.lang.OutOfMemoryError:超出了GC开销限制 - Getting Error:java.lang.OutOfMemoryError: GC overhead limit exceeded 错误 java.lang.OutOfMemoryError:超出 GC 开销限制 - Error java.lang.OutOfMemoryError: GC overhead limit exceeded 错误:java.lang.OutOfMemoryError:超出了GC开销限制 - Error:java.lang.OutOfMemoryError: GC overhead limit exceeded IntelliJ 错误:java.lang.OutOfMemoryError:超出 GC 开销限制 - IntelliJ Error: java.lang.OutOfMemoryError: GC overhead limit exceeded java.lang.OutOfMemoryError:读取大文本文件时超出了GC开销限制 - java.lang.OutOfMemoryError: GC overhead limit exceeded while Reading a Large Text file 在Eclipse上运行时,Stanford CoreNlp错误“ java.lang.OutOfMemoryError:超出了GC开销限制” - Stanford CoreNlp error “java.lang.OutOfMemoryError: GC overhead limit exceeded” while running on eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM