High memory usage with "Remove unused streams" optimization

Hi,

We found that using following code:
using Aspose.Pdf;
using (var pdf = new Document(“Big.pdf”))
{
pdf.OptimizeResources(
new Document.OptimizationOptions { RemoveUnusedStreams = true }
);
}
On attached file:
Takes ~25 times more RAM than without RemoveUnusedStreams.
With RemoveUnusedStreams = true peak RAM usage is 1600 Mb (!!!)
With RemoveUnusedStreams = true peak RAM usage is 60 Mb

Please, note issue can be reproduced with any pdf file.

Same issue already posted here https://forum.aspose.com/t/72168.

Hi Ulrik,


Thanks for your inquiry. I have
tested optimization with RemoveUnsedStreams property and noticed the reported performance issue. For further investigation, I have logged
an issue in our issue tracking system as PDFNEWNET-40691. We
will keep you updated via this thread regarding the issue status.<o:p></o:p>

We are sorry for the inconvenience caused.

Best Regards,

Hi,


I met this issue too. Are there any updates?

Thanks,
Dung H. Nguyen
dunghnguyen:
Hi,

I met this issue too. Are there any updates?
Hi Dung,

Thanks for contacting support.

I am afraid the earlier reported issue is not yet resolved. However we request you to please share the input files and sample project which can help us replicating the issue which you are facing. Please note that performance related issues are mostly document specific as they depend upon structure and complexity of input document.

We are sorry for your inconvenience.