Free Support Forum - aspose.com

Aspose.Words' DOM eats all the memory

Is this still on your roadmap?

I am having similar issues. Seems like the word dom eats all the memory. Any improvement in outputting largish word documents would be appriciated.

Hi Mari,


Thanks for your inquiry. Could you please attach your input documents, you’re getting this exception with, here for testing? I will investigate the issue on my side and provide you more information. Moreover, it is safe to attach files in the forum. If you attach your documents here, only you and Aspose staff members can download it.

Best Regards,

Templates and example data source attached. Profiling the execution it seems pretty clear the memory is used for the dom.

  • Template: 'executive-report_docx_A4.jasper’
  • data source: JaxenXmlDataSource dataSrc = new JaxenXmlDataSource(new File(“data.xml”),"./report");
  • Using java -Xmx768M
  • I am expecting ~1000 pages.

Stack:

java.lang.OutOfMemoryError: Java heap space
at a.a.b.f.hU(Unknown Source)
at a.a.b.f.hT(Unknown Source)
at a.a.b.f.writeByte(Unknown Source)
at a.a.b.j.write(Unknown Source)
at com.a.a.a.c.b.write(Unknown Source)
at com.a.a.a.c.b.write(Unknown Source)
at com.a.a.a.c.a.lj(Unknown Source)
at a.a.d.c.lj(Unknown Source)
at a.z.endElement(Unknown Source)
at com.aspose.words.sv.p(Unknown Source)
at com.aspose.words.sv.g(Unknown Source)
at com.aspose.words.acr.a(Unknown Source)
at com.aspose.words.zb.a(Unknown Source)
at com.aspose.words.eb.b(Unknown Source)
at com.aspose.words.xv.a(Unknown Source)
at com.aspose.words.eb.b(Unknown Source)
at com.aspose.words.kc.a(Unknown Source)
at com.aspose.words.eb.b(Unknown Source)
at com.aspose.words.adj.a(Unknown Source)
at com.aspose.words.eb.b(Unknown Source)
at com.aspose.words.wt.a(Unknown Source)
at com.aspose.words.eb.b(Unknown Source)
at com.aspose.words.uu.a(Unknown Source)
at com.aspose.words.acr.j(Unknown Source)
at com.aspose.words.ff.kU(Unknown Source)
at com.aspose.words.ff.bJ(Unknown Source)
at com.aspose.words.acr.write(Unknown Source)
at com.aspose.words.vi.kU(Unknown Source)
at com.aspose.words.vi.a(Unknown Source)
at com.aspose.words.gx.a(Unknown Source)
at com.aspose.words.gx.a(Unknown Source)
at com.aspose.words.jasperreports.AWAbstractExporter.l(Unknown Source)

Hi Mari,

Thanks for sharing the JRXML files. I am unable to execute the shared jrxml files. Will I have to change some directory setting in jrxml files to executeexecutive-report_docx_A4.jrxml file? I have put all files in the same folder and execute executive-report_docx_A4.jrxml with iReport as well with no success.

You have shared 24 jrxml files. It would be great if you please share specific jrxml files along with proper directory structure for sub-reports and jrtx files.

It is difficult to say where the problem in iReport settings is without all details. I decided creating a reproduction package that runs the report from java code. See attached zip file and README.txt for instructions.

Hi Mari,


Thanks for sharing the details. I have tested the scenario and have found that the memory issue is with following line of code, not with AWDocxExporter. You can test this scenario by commenting the code of Aspose.Words for Jasper Reports.

<span lang=“EN-GB” style=“font-size:
10.0pt;line-height:115%;font-family:“Courier New”;background:yellow;mso-highlight:
yellow;mso-font-kerning:0pt;mso-no-proof:yes”>JasperPrint print =
JasperFillManager.fillReport(template, COMMON_REPORT_PROPERTIES, dataSrc);

Please let us know if you have any more queries.

Thanks, I’ll do a another round of memory profilation. Maybe I misinterpreter something as I thought it was in the exporter.

Hi Mari,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.