|
Rank: Newbie Groups: Member
Joined: 9/12/2016 Posts: 2
|
Hi,
We are using EO PDF 16.7.2 on production servers - 6 Load balanced servers, ASP.Net MVC multi-tenant app.
After the upgrade to this version from version 4.0, we are facing memory leaks that create Memory Exhaustion exception and recycles the pool. Due to bot activity and user activity, atleast 1 server runs out of memory every couple of minutes. We see that the eowp.exe is not killed after a PDF generation and more and more eowp.exe with 50-100 mb each gets added. Solutions tried:
1. EO.Base.Runtime.EnableLargeAddressSpace = true; 2. EO.Base.Runtime.Shutdown();
below is the code:
using (Isolated<PdfConverter> isolated = new Isolated<PdfConverter>()) { pdfBytes = isolated.Value.Process( new PdfParameters { Key = currentController.AppConfig.EoPdfKey, PDFUrls = PDFUrls, Url = this.Url, Header = string.Empty, HideItemIds = "", Cookies = ConvertHttpToNetCookies(context) }); }
Isolated is a class that creates appdomain to generate the PDF(http://www.superstarcoders.com/blogs/posts/executing-code-in-a-separate-application-domain-using-c-sharp.aspx).
Can you please find out the reason for this memory leak.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, Please try to isolate the problem into a test project and send the test project to us. See here for more details: https://www.essentialobjects.com/forum/test_project.aspxOnce we have that we will be happy to investigate further. Thanks!
|
|
Rank: Member Groups: Member
Joined: 6/14/2013 Posts: 11
|
Hi,
We started using 2017 version and above code is creating issue again.
We can not recreate the issue on test project or on other environment.
We can provide you with memory dump from the production server where this memory leak issue happens. Would that help ?
Regards, Mihir
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
No. For this kind of issue we do need a test project in order to pinpoint the problem precisely. There are numerous cases that can cause memory issue --- for example, you could have code that continues allocating objects in our library without releasing them and the memory dump will show the memory is used by our objects, but in this case the root of the problem is your code. So memory dump alone can not pinpoint the problem precisely.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 6/14/2013 Posts: 11
|
Hi,
We have submitted test project to the support email.
Regards, Mihir
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Yes. We have received the test project. We will look into it and get back to you as soon as possible.
|
|
Rank: Member Groups: Member
Joined: 6/14/2013 Posts: 11
|
Hi,
Any updates?
Regards, Mihir
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
Sorry about the delay. We have looked into this and did find an issue with AppDomains. This will be fixed in our next build.
We do support multiple AppDomains however there is a racing issue when multiple AppDomains are created simultaneously, which is your case. Generally it is not necessary to create multiple AppDomains for HTML to PDF conversion because it's actually much more efficient to do the conversion in a single AppDomain since each AppDomain maintains separate browser engine objects and cache path. In your test code if you make the following modifications:
1. Remove your Isolated class; 2. Remove EO.Base.Runtime.Shutdown call;
Then it will perform all conversions in the current AppDomain and you should not see any issues. You will see many rundll32.exe being created as you start the conversion, however they will automatically exit after being idle for a while (about 10 minutes).The 2017 version does create a lot more child processes than older versions, this is because newer version uses Chromium browser engine which uses a multi-process architecture that isolates different parts of the browser engine. However they still share code memory and communicates efficiently with each other.
Please feel free to let us know if you still have any questions.
Thanks!
|
|