- Code: Select all
/* tmp is an hibernate object that loads the docx template from a database */
InputStream fileInputStream = new ByteArrayInputStream(tmp.getFile());
LoadFromZipNG load = new LoadFromZipNG();
OpcPackage pkg = load.get(fileInputStream);
ByteArrayOutputStream out = new ByteArrayOutputStream();
SaveToZipFile save = new SaveToZipFile(pkg);
save.save(out);
byte[] bytes = out.toByteArray();
out.close();
return bytes;
But after the execution of this code, the memory consumption of my application raises, and analyzing the memory dumps of the heap memory, i found a lot of doc4x objects no garbage collected.
For example:
- Code: Select all
org.docx4j.wml.STBorder (191 objects)
org.docx4j.dml.STShapeType (187 objects)
org.docx4j.dml.STPresetColorVal (140 objects)
Any ideas of what could be the problem?
i think maybe you need more information, please let me know and i will provide it if i can.
thanks,
regards,