gpt4 book ai didi

java.lang.OutOfMemory错误: Java heap space:Trying to use jasper exportreport method

转载 作者:行者123 更新时间:2023-12-01 14:06:18 24 4
gpt4 key购买 nike

使用 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%以上。如何找出此问题的确切根本原因。

最佳答案

看来 Xmx 设置有问题。您应该确保它设置得足够高。如果您怀疑其他问题可能是问题所在,您可以在运行 oom 时创建堆转储并检查是否存在泄漏对象。这可以通过添加两个参数来完成。

-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/path/to/heapdump

然后您可以使用 jvisualvm 或 Eclipse MAT(内存分析器工具)对其进行分析

关于java.lang.OutOfMemory错误: Java heap space:Trying to use jasper exportreport method,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18872336/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com