System.OutOfMemory Exception in azure app services (premium plan with 14GB & Isoloated App Service Plan)

Version used: 20.11.0. (Due to technical issues we cannot upgrade to latest version of Aspose)
Am using 3 word documents(.doc) 25MB, 40MB and 58MB files to convert to pdf and merge to a parent PDF file. We have our service hosted in Azure app service with 8GB capacity and we are facing frequent out of memory issues. The memory capacity of the app service was increased to 14 gb/840 acu plan but still the problem persists. The plan was upgraded to use Isolated instance but we couldn’t get rid of the problem. However, the out of memory problem is not observed in VMs. Below is the analysis data. From the data it is very clear that, though app service has enough memory, aspose is throwing out of memory exception. Please help us here.

app service plan 840 acu/14gb
Parallel Requests Memory Consumption in % CPU % Result
1 12% 18 All calls Successful
2 18 25 All calls Successful
5 35 upto 93 all failed memory exception

isolated ASP 420acu/7gb
Parallel Requests Memory Consumption in % CPU % Result
1 25 27 success
2 35 95 success
5 50 98 failed out of memory

here is the exception captured.
at System.IO.MemoryStream.set_Capacity (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)

at System.IO.MemoryStream.EnsureCapacity (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)

at System.IO.MemoryStream.Write (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)

at Aspose.Words.Document.[1] (Aspose.Words, Version=20.11.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at Aspose.Words.Document.[1] (Aspose.Words, Version=20.11.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at Aspose.Words.Document.Save (Aspose.Words, Version=20.11.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at Aspose.Words.Document.Save (Aspose.Words, Version=20.11.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)

at AsposeMemoryAnalysisWeb.WordToPdfConverter.ConvertToPdf (AsponseMemoryAnalyzeWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)

@ravieurofins,

Please ZIP and upload your source Word documents (you are getting this problem with) here for testing along with the source code that will help us to reproduce the same problem on our end. We will then investigate the issue on our end and provide you more information.

P.S. If your .zip file has bigger size than the attachment limit in this forum then you may upload the ZIP file to Dropbox or any other file hosting service and share the download link here for testing.

@awais.hafeez, I found out that we have a paid support from aspose, i’ll post this question under paid support and upload the docs (docs cannot be posted in public).

@ravieurofins,

I am unable to move this forum thread in Paid Support Helpdesk because this user (ravieurofins) does not seem to have a Paid Support subscription linked to it. You may please use your other Paid Support Account/Subscription and post a query in our Paid Support Helpdesk.