Welcome Guest Search | Active Topics | Sign In | Register

EO.Base.ChildProcessOutOfMemoryException occred When use webfont Options
JMDC
Posted: Friday, May 26, 2017 1:49:33 AM
Rank: Newbie
Groups: Member

Joined: 5/25/2017
Posts: 5
Hi,
I am using Eo.PDF v17.1.55.
I use HtmlToPdf.ConvertHtml to covert the html to pdf, when Eo.PDF run about 70 times, It occured ChildProcessOutOfMemoryException.
My html is including D3.js, WebFont, svg.

I found japanese font NotoSansCJKjp can resulting in ChildProcessOutOfMemoryException.

Quote:
@font-face {
font-family: "NotoSansCJKjp Bold";
src: url(file://C:/Users/rson/Documents/haapi/pdfhtml/font/NotoSansCJKjp-Bold.otf) format('opentype');
}


How I can do ?

eo_support
Posted: Friday, May 26, 2017 2:19:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

Please try a few things:

1. Set EO.Base.Runtime.EnableEOWP to true:

https://www.essentialobjects.com/doc/eo.base.runtime.enableeowp.aspx

This property will double the work process's available memory space from 2GB to 4GB and should resolve most out of memory issue;

2. If you haven't already done so, upgrade to .65 build. Build .55 can crash when your page is extremely wide. Build .65 fixed this issue.

If you continue to have problems after the above change, 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!
JMDC
Posted: Sunday, May 28, 2017 9:31:17 PM
Rank: Newbie
Groups: Member

Joined: 5/25/2017
Posts: 5
Hi,

I send test file to you.

when I installed the NotoSansCJKjp font to the server running Eo.pdf, and use local fonts, It run well.

@font-face {
font-family: "NotoSansCJKjp Bold";
src: local(Noto Sans CJK JP)
}
eo_support
Posted: Tuesday, May 30, 2017 8:20:00 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

We have looked into this issue and it does appear to be an issue in the browser engine. If you load the sample page in Google Chrome browser and keeps refereshing the page, the memory usage of one of the child process will keep climbing up. However because Google Chrome is 64 bit by default, so it will take a long time for it to run out of memory. EO.WebBrowser on the other hand, runs the child process in 32 bit in order to be compatible with 32 bit systems and it will reach the per process memory limit very quickly.

It is not practical for us to fix such memory issues inside the browser engine. So your best option is to change your code to tolerate it. In your case, you can do the following:

1. Handle EO.Base.Runtime.Exception event to silent this error;
2. Use a try catch block to catch exception for ConvertHtml/ConvertUrl and try again if it fails;

This way the ChildProcessOutOfMemoryException will still occur but because it crashes the child process, the next time you call ConvertHtml/ConvertUrl again, it should start a new child process and this child process will succeed. The new child process can perform a number of conversions again and it will eventually crashes and another one will start over again. However your application can safely rely on such recycling mechanism and still handle the request correctly due to such recovering behavior.

Thanks!
JMDC
Posted: Tuesday, May 30, 2017 9:59:30 PM
Rank: Newbie
Groups: Member

Joined: 5/25/2017
Posts: 5
Thanks a lot. Eo.pdf is best C# library for converting HTML to PDF really.
eo_support
Posted: Wednesday, May 31, 2017 9:33:34 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Glad to hear that! Please feel free to let us know if you have any other questions.


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.