Aspose components use the .NET MemoryStream

Here's how I tested the hotfix Aspose.Email.dll:

Starting with the AsposeTestApp sources I supplied in my original post, I edited the Project and added a Reference to the Microsoft.IO.RecyclableMemoryStream.dll and modified the other, existing Reference to specify the hotfix dll rather than the current release of Aspose.Email.dll

After building, I ran the test app at the command line with no switches:

T:\Development\Sandbox\Aspose\AsposeTestAppSourceFromZip> bin\x86\Debug\AsposeTestApp.exe
usage: AsposeTestApp {chunk_count}
    chunk_count defaults to 20000 if omitted. Each chunk is 100KB

ConsumeMemory requested 20000 100KB chunks. Allocation failure occurred when idx = 19205

The type initializer for ‘Aspose.Email.Mail.MessageFormat’ threw an exception.
at Aspose.Email.Mail.MessageFormat.get_Msg()
at Aspose.Email.Mail.MailMessage.#=qMvXvgPuXSx3ZDlbMRgY7jQ==(Stream #=qwZ9llg4X$PEWn92B948F4g==,LoadOptions& #=qCDx1iBL_NwOTZHxtQKkOdw==)
at Aspose.Email.Mail.MailMessage.#=qynkIglnJHI$YFZum3j2v0DpCXIi73w04C0P7l1v73yk=(Stream #=qwZ9llg4X$PEWn92B948F4g==, LoadOptions #=qCDx1iBL_NwOTZHxtQKkOdw==)
at Aspose.Email.Mail.MailMessage.Load(Stream stream)
at Aspose.Email.Mail.MailMessage.Load(String fileName)
at AsposeTestApp.Program.Main(String[] args) in t:\Development\Sandbox\Aspose\AsposeTestAppSourceFromZip\Program.cs:line 32

Reducing 19205 slightly, I ran AsposeTestApp.exe again, but this time with 19000 on the command line:

T:\Development\Sandbox\Aspose\AsposeTestAppSourceFromZip> bin\x86\Debug\AsposeTestApp.exe 19000
usage: AsposeTestApp {chunk_count}
    chunk_count defaults to 20000 if omitted. Each chunk is 100KB

Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.IO.MemoryStream…ctor(Int32 capacity)
at #=qLrIs6TkKtGQgnTyqaxYoFYJqi6AhxFCUazCfb7BD5M9m90tm4fjv0tuwDKPJ0GRQ.#=qaWaBlz2ObHg88F$GxGdVzg==(UInt32 #=qui4X0fhPAaVikFSIj4Vmtw==, Int32 #=qvGrTNMRGAQ6GNRTyeRriFA==, Boolean #=qhkAVqY4ezk$EFzC7Yp1hbw==)
at #=qLrIs6TkKtGQgnTyqaxYoFYJqi6AhxFCUazCfb7BD5M9m90tm4fjv0tuwDKPJ0GRQ.#=q6mNfCfl6y4dfpsK8zi2esQ==()
at #=qLrIs6TkKtGQgnTyqaxYoFYJqi6AhxFCUazCfb7BD5M9m90tm4fjv0tuwDKPJ0GRQ.#=qtIcPRCyzw4wfk8VPf3KyGg==(Stream #=qwZ9llg4X$PEWn92B948F4g==)
at #=qLrIs6TkKtGQgnTyqaxYoFYJqi6AhxFCUazCfb7BD5M9m90tm4fjv0tuwDKPJ0GRQ…ctor(Stream #=qwZ9llg4X$PEWn92B948F4g==)
at Aspose.Email.Outlook.MapiMessageReader…ctor(Stream stream)
at Aspose.Email.Mail.MailMessage.#=qcDIsnTl2Xpysxrnaqgob0g==(Stream #=qwZ9llg4X$PEWn92B948F4g==,MsgLoadOptions #=qCDx1iBL_NwOTZHxtQKkOdw==)
at Aspose.Email.Mail.MailMessage.#=qynkIglnJHI$YFZum3j2v0DpCXIi73w04C0P7l1v73yk=(Stream #=qwZ9llg4X$PEWn92B948F4g==, LoadOptions #=qCDx1iBL_NwOTZHxtQKkOdw==)
at Aspose.Email.Mail.MailMessage.Load(Stream stream)
at Aspose.Email.Mail.MailMessage.Load(String fileName)
at AsposeTestApp.Program.Main(String[] args) in t:\Development\Sandbox\Aspose\AsposeTestAppSourceFromZip\Program.cs:line 32

As you can see I get an OutOfMemoryException thrown by a MemoryStream object.

I further reduced 19000 to 18500 and ran AsposeTestApp again - and there was another OutOfMemoryException:

Exception of type 'System.OutOfMemoryException' was thrown.
   at Aspose.Email.Outlook.MapiProperty..ctor(String name, Int64 tag, Int64 signed, Byte[] data)
   at #=q4L1nJgJ6IWe_ooj_xtUz6kismHrfEueUvSLyjZdtAXxH_xQPpuRBriTdB2YNLXP_.#=qKpweR87dpcMET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VadyYncmssfk_IubhttTKnzwAxpFxcTC5wGxLA2R5QB7 #=qdpFoWmNIE12NLYWtfpeQ3Q==)
   at Aspose.Email.Outlook.MapiMessageReader.ReadMessage()
   at Aspose.Email.Mail.MailMessage.#=qcDIsnTl2Xpysxrnaqgob0g==(Stream #=qwZ9llg4X$PEWn92B948F4g==,MsgLoadOptions #=qCDx1iBL_NwOTZHxtQKkOdw==)
   at Aspose.Email.Mail.MailMessage.#=qynkIglnJHI$YFZum3j2v0DpCXIi73w04C0P7l1v73yk=(Stream #=qwZ9llg4X$PEWn92B948F4g==, LoadOptions #=qCDx1iBL_NwOTZHxtQKkOdw==)
   at Aspose.Email.Mail.MailMessage.Load(Stream stream)
   at Aspose.Email.Mail.MailMessage.Load(String fileName)
   at AsposeTestApp.Program.Main(String[] args)

It's worth noting that the RecyclableMemoryStream assembly hasn't even been loaded at this point.

Based on this very limited testing I'm sorry to have to report that the defect is not fixed, because the Aspose.Email.dll still contains MemoryStream objects that need to be replaced by RecyclableMemoryStream objects.

Hi Brian,


Thank you for sharing your feedback.

We have logged these comments against the logged ticket for further consideration by our Product team. Our Product team will further investigate the issue and we’ll get back to you on this once more information is available in this regard.

Hi Support


Can I have an update on this case please?

Thanks

Hi Brian,


Thanks for your patience.

I am afraid the earlier reported issues are not yet resolved. However I have requested the latest updates from respective teams and as soon as we have some further updates, we will let you know.

We are sorry for this delay and inconvenience.

Can I have an update on this please?

Thanks

@Brian_THOMAS,

Thanks for your patience.

I am afraid the earlier reported issue is not yet resolved but the team is working on fixing it. As soon as we have some definite updates, we will let you know.

We are sorry for this delay and inconvenience.

What has become of the zipped C# project I attached to this case?

Could it have disappeared when you migrated from the old forum software to the new?

@Brian_THOMAS,

Thanks for contacting support.

I am afraid I am unable to find the zip archive in this thread. Can you please again share the files, so that we can test the scenario in our environment and share our findings. We are sorry for this inconvenience.

The OneDrive location of the zipped project is here. The zip file is too large to upload to your forum.

[https://kutana-my.sharepoint.com/personal/brian_thomas_kutana_co_uk/_layouts/15/guestaccess.aspx?docid=15dc78adff670482a9e608857e3ad06f9&authkey=ATidhPq-tOtDlc3DiGjvsqA&e=fc387c56a230473988fbd3ffd203d77c ](https://kutana-my.sharepoint.com/personal/brian_thomas_kutana_co_uk/_layouts/15/guestaccess.aspx?docid=15dc78adff670482a9e608857e3ad06f9&authkey=ATidhPq-tOtDlc3DiGjvsqA&e=fc387c56a230473988fbd3ffd203d77c)

@Brian_THOMAS,

Thanks for sharing the sample project. We are further testing it with latest release and will keep you updated with our findings.

@Brian_THOMAS,

The issue EMAILNET-35246 is still not resolved as it involves complexity. We’ll let you know as there is some information available in this regard.