Welcome Guest Search | Active Topics | Sign In | Register

PDF generation Memory leak Options
Sriraj Madhavan
Posted: Tuesday, April 18, 2017 4:46:44 PM
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
eo_support
Posted: Tuesday, April 18, 2017 5:16:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
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.aspx

Once we have that we will be happy to investigate further.

Thanks!
Kunal Choudhary
Posted: Wednesday, February 7, 2018 1:48:46 PM
Rank: Newbie
Groups: Member

Joined: 6/14/2013
Posts: 8
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
eo_support
Posted: Wednesday, February 7, 2018 2:51:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
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!
Kunal Choudhary
Posted: Monday, February 12, 2018 1:54:13 PM
Rank: Newbie
Groups: Member

Joined: 6/14/2013
Posts: 8
Hi,

We have submitted test project to the support email.

Regards,
Mihir
eo_support
Posted: Tuesday, February 13, 2018 12:42:47 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
Yes. We have received the test project. We will look into it and get back to you as soon as possible.
Kunal Choudhary
Posted: Tuesday, February 20, 2018 11:00:49 AM
Rank: Newbie
Groups: Member

Joined: 6/14/2013
Posts: 8
Hi,

Any updates?

Regards,
Mihir
eo_support
Posted: Wednesday, February 21, 2018 7:35:33 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.