Hello. We are using aspose.pdf in our product and using it to search with regex certain patterns.
My IDE is claiming that there is a big memory allocations for pdf document object.
The code example which is shows that:
using var pdfDocument = new Pdf.Document(inputStream);
var patterns = input.Texts.Aggregate((acc, next) => $"({acc})" + "|" + $"({next})");
var textFragmentAbsorber =
new TextFragmentAbsorber(new Regex($"{patterns}", RegexOptions.IgnoreCase));
pdfDocument.Pages.Accept(textFragmentAbsorber);
…Process result
And IDE shows me that 18425 mb allocated on this line pdfDocument.Pages.Accept(textFragmentAbsorber);
The test document if 140 pages document with size of 1.6 mb.
What can we do with this? I think this may lead to problem when there will be high amount of users using that. We are in development process and going to production soon. Don’t want to face into the issue with memory.