Free Support Forum - aspose.cloud

OutOfMemoryException with Constructor Aspose.Pdf.Document

I get an OutOfMemoryException with new Aspose.Pdf.Document(workStream, objLoadOption) (On Premise API) where workStream is a byte[] for an Html string of length < 20M

Exception looks to be 250 calls deep.
Commences at:
at Aspose.Pdf.Document.#=zpVN_2Rc=(Stream #=zet709qk=, LoadOptions #=zmSsktBU=)
at Aspose.Pdf.Document…ctor(Stream input, LoadOptions options)

Q1 Does the HTML have to meet specific requirements to guarentee that an OoME will not be generated. If so what are they?

Q2 Is there a way of coding, to limit the memory that this constructor wants to allocate such that the OoME never arises. I’d rather have a Exception indicating trying to allocate too much memory.

OcME is a production environment is pretty serious, any assiatance would be greatfully received

This topic has been moved to the related forum: https://forum.aspose.com/t/outofmemoryexception-with-constructor-aspose-pdf-document/225195