Aspose.word for java . Version25.9
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>25.9</version>
<classifier>jdk17</classifier>
</dependency>
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
buidler.insertHtml("......");
SaveOptions saveOptions = SaveOptions.createSaveOptions(SaveFormat.DOCX);
saveOptions.setMemoryOptimization(true);
doc.save("test.docx", saveOptions);
doc.cleanup();
How to control memory growth caused by generating a large number of doc documents leading to increased memory usage.
@dhzhao2016 Unfortunately, there is no way to control memory usage by Aspose.Words. Memory usage depends on many factors. Please see the following article for more information:
https://docs.aspose.com/words/net/memory-requirements/
@dhzhao2016 The information provided in the above mentioned article is applicable for both .NET and Java versions of Aspose.Words.
@dhzhao2016 There is no need to free up memory manually manually. Aspose.Words does not keep any unmanaged resources in memory. Memory is freed automatically to garbage collector.
The memory of version 20.2 from a long time ago did not increase. I hope to control the growth and release of memory in the new version
@dhzhao2016 As it was mentioned, Aspose.Words does not keep unmanaged resource in memory, that must be manually disposed. So there is no need to release memory manually.