Hello there,
I am running into some memory problems when running Aspose.Words for .NET (version 9.4) to save a word document (either .DOC or .DOCX) to PDF format.
It seems that for big documents (about 20 MB DOCX) memory consumption, while executing the document.Save method, starts to build up until one of two things happens:
- If I am running the code inside a web application (which is the case of the product we are using Aspose.Word on), after a while I get a System.OutOfMemoryException on my web app and the document does not get converted.
- If I am running the code inside a small Windows Forms test application (it just opens the document and saves as PDF, nothing else), it takes a while but does manage to convert the document, however, during the conversion I look at the task manager to check memory consumption and I notice that the process running aspose.words goes up in memory until it reaches 1 GB, and then stays there, even after the document is converted.
Given these situations what I would like to know is the following:
- Can you advise on what is the best method to dispose of your components in the code, so that we can prevent it from holding memory resources when they are no longer needed ?
- Do you know of any reason why it works on a windows forms app, and not on a web app ? Can it have something to do with IIS (version 6) limiting the amount of memory used by a running web app ? The app is running on IIS on Mixed Mode, I will try in Isolated Mode as well.
- I noticed on other similar threads that you advise against using such large documents, do you have any limit regarding the size of the documents that your component can handle without running into memory problems ?
- Do you plan to correct this memory consumption issue for future releases of aspose.words ? If so, can you give me an estimate on when these issues will be corrected ?
We are using Aspose.Words on a product, and even though we can advise our clients not to use large documents we can’t really guarantee that they won’t, so we need to have a way to prevent such high memory consumption when dealing with large documents.
Thank you for your time,
Joao Maia