Hi,
I’ve noticed that Aspose.Words uses quite a bit of large object heap memory on loading/saving documents, to the point where it becomes problematic for my application. In my production code, I often need to load a document template, load a ‘content library’ of sorts, merge some of the content from the library into the document, and save the result. These documents can often be of significant size, and there’s usually lots of operations like this immediately one after another. I’ve noticed that LOH size jumps up whenever I use aspose library load or save a document. I’ve put together an example that replicates the issue (attached). In this example, I load a file from the disk, save it to memory stream, reload it from memory stream, and save it to disk. I am using a relatively large file in the example (around 5mb), but still the amounts of memory on LOH are larger than what I would expect. During the load from disk, around 12 mb of LOH memory is allocated, when saving to stream - around 15,5mb, loading from stream - 7 mb, and saving to disk - further 6 mb. Could you please have a look and let me know whether there’s anything you can optimize in these operations, or if there are any flags/settings I can use to mitigate the LOH allocations?
Thanks,
Tomek
PerformanceInvestigation.zip (4.8 MB)