We also used profiling to find out the objects in memory at any time and found these object even when we are not using docx4j related links.
org.docx4j  1 16 bytes 
 org.docx4j.bibliography  33 792 bytes 
 org.docx4j.customXmlProperties  3 48 bytes 
 org.docx4j.customxml  4 64 bytes 
 org.docx4j.dml  1,756 40,160 bytes 
 org.docx4j.dml.chart  814 14,744 bytes 
 org.docx4j.dml.chartDrawing  54 864 bytes 
 org.docx4j.dml.diagram  472 10,760 bytes 
 org.docx4j.dml.diagram2008  18 288 bytes 
 org.docx4j.dml.picture  5 80 bytes 
 org.docx4j.dml.spreadsheetdrawing  74 1,224 bytes 
 org.docx4j.dml.wordprocessingDrawing  107 2,112 bytes 
 org.docx4j.docProps.core  24 384 bytes 
 org.docx4j.docProps.core.dc.elements  2 32 bytes 
 org.docx4j.docProps.core.dc.terms  1 16 bytes 
 org.docx4j.docProps.custom  67 1,064 bytes 
 org.docx4j.docProps.extended  55 880 bytes 
 org.docx4j.docProps.variantTypes  148 2,336 bytes 
 org.docx4j.math  236 4,272 bytes 
 org.docx4j.model.structure  12 312 bytes 
 org.docx4j.model.structure.jaxb  3 48 bytes 
 org.docx4j.openpackaging.contenttype  6 88 bytes 
 org.docx4j.openpackaging.parts  3 48 bytes 
 org.docx4j.openpackaging.parts.relationships  4 96 bytes 
 org.docx4j.relationships  5 80 bytes 
 org.docx4j.vml  837 14,200 bytes 
 org.docx4j.vml.officedrawing  286 5,584 bytes 
 org.docx4j.vml.presentationDrawing  1 16 bytes 
 org.docx4j.vml.root  1 16 bytes 
 org.docx4j.vml.spreadsheetDrawing  30 848 bytes 
 org.docx4j.vml.wordprocessingDrawing  67 1,824 bytes 
 org.docx4j.wml  1,878 40,208 bytes 
 org.docx4j.xmlPackage  12 192 bytes 
 
We also do get an exception when executing the docx4j code. This is related to not finding the docx4j.properties file. Our concern here is that this results in a null pointer exception as follows:
- Code: Select all
 ava.lang.NullPointerException
   at org.docx4j.utils.ResourceUtils.getResource(ResourceUtils.java:45)
   at org.docx4j.Docx4jProperties.init(Docx4jProperties.java:19)
   at org.docx4j.Docx4jProperties.getProperties(Docx4jProperties.java:34)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:207)
   at org.docx4j.openpackaging.io.SaveToZipFile.saveRawXmlPart(SaveToZipFile.java:194)
   at org.docx4j.openpackaging.io.SaveToZipFile.savePart(SaveToZipFile.java:410)
   at org.docx4j.openpackaging.io.SaveToZipFile.addPartsFromRelationships(SaveToZipFile.java:373)
   at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:164)
   at org.docx4j.openpackaging.io.SaveToZipFile.save(SaveToZipFile.java:105
The concern is that the SaveToZipFile.saveRawXmlPart also has code to close output streams . Will these output streams remain open due to this exception and therby result in memory issues?