使用 jaspers exportreport 方法时出现内存错误。堆栈跟踪如下所示。
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.text.RuleBasedBreakIterator.readFile(Unknown Source)
at java.text.RuleBasedBreakIterator.readTables(Unknown Source)
at java.text.RuleBasedBreakIterator.<init>(Unknown Source)
at java.text.BreakIterator.createBreakInstance(Unknown Source)
at java.text.BreakIterator.getBreakInstance(Unknown Source)
at java.text.BreakIterator.getLineInstance(Unknown Source)
at java.text.BreakIterator.getLineInstance(Unknown Source)
at java.awt.font.LineBreakMeasurer.<init>(Unknown Source)
at net.sf.jasperreports.engine.fill.TextMeasurer.renderParagraph(TextMeasurer.java:655)
at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:367)
at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:511)
at net.sf.jasperreports.engine.fill.JRFillTextField.prepare(JRFillTextField.java:607)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:328)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:393)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:352)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2023)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:755)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:285)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:132)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:765)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:540)
at com.aricent.aircell.logpatternanalyzer.report.JasperReportUtils.exportReport(JasperReportUtils.java:86)
我也试过内存泄漏分析器和 jvisualvm 来找出根本原因,但它显示char[]
占用超过 90%。如何找出此问题的确切根本原因。