Export to Excel - GC overhead limit exceeded

0
Hi Forum,   I have a use case where I need to export ~150.000 objects to Excel (Report10HelperList). The Export microflow does nothing fancy, it just creates the input object (NewExcelExportHelper) and links the Report10HelperList to it. It then generates the Excel file based on the Template. We have 12 other reports where we do the same thing and those work fine. However, for this report, when the number of objects exceeds ~110.000 the Java action throws: java.lang.OutOfMemoryError: GC overhead limit exceeded     at java.util.HashMap.resize(HashMap.java:703)     at java.util.HashMap.putVal(HashMap.java:628)     at java.util.HashMap.putMapEntries(HashMap.java:514)     at java.util.HashMap.putAll(HashMap.java:784)     at org.apache.xmlbeans.XmlOptions.<init>(XmlOptions.java:102)     at org.apache.xmlbeans.impl.values.XmlObjectBase.makeInnerOptions(XmlObjectBase.java:265)     at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1489)     at org.apache.poi.xssf.model.SharedStringsTable.getKey(SharedStringsTable.java:134)     at org.apache.poi.xssf.model.SharedStringsTable.addEntry(SharedStringsTable.java:180)     at org.apache.poi.xssf.usermodel.XSSFCell.setCellValue(XSSFCell.java:453)     at org.apache.poi.xssf.usermodel.XSSFCell.setCellValue(XSSFCell.java:417)     at xlsreport.report.export.ExportExcel.SetCellValue(ExportExcel.java:343)     at xlsreport.report.export.ExportExcel.buildExportFile(ExportExcel.java:139)     at xlsreport.actions.GenerateExcelDoc.executeAction(GenerateExcelDoc.java:133)     at xlsreport.actions.GenerateExcelDoc.executeAction(GenerateExcelDoc.java:34)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55)     at com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:150)     at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)     at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155)     at com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:414)     at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:56)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:201)     at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57)     at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55)     at com.mendix.basis.actionmanagement.DefaultActionMonitor$.$anonfun$run$1(CustomMonitoredAction.scala:18)   Increasing the Java Heap Size results in the error no longer popping up, yet it seems GC makes the application so slow that it basically flatlines and the report is never generated.   Does anyone have a suggestion on how to tackle this issue? I guess normally batching would make a difference, but here the problem lies inside the Java action and I do not have enough knowledge to tinker with it…   Mendix version is 7.23.19 but I could not select that from the list Any help is much appreciated! Kind regards,   Ruben Nuijten
asked
1 answers
1

Perhaps try to commit the ExcelExportHelper object with the associated list first and run the report in an async flow? This way the object and list are not in memory within the same thread. 

You can test this quickly by using runMicroflowAsyncInQueue from Communitycommons module. 

Not entirely sure this will help :) 

answered