Welcome Guest Search | Active Topics | Sign In | Register

Eowp.exe memory usage, cannot restart after EO.Base.Runtime.Shutdown() Options
Erik R
Posted: Thursday, January 30, 2020 4:40:27 AM
Rank: Newbie
Groups: Member

Joined: 4/15/2016
Posts: 3
We made an Office add-in using a EO.WebBrowser.Webview control. In our configuration, we always use EO.Base.Runtime.EnableEOWP = true, so that eowp.exe is started to host the Chrome engine.

Customers using (Citrix) terminal server report an issue with our add-in: specifically opening a new iframe regularly does not work when the terminal server is busy. They claim the problem started after we upgraded to EO Total 2018. We currently ship our product with version 18.3.46.0, before that we were using version 16.2.23.0.

Eowp.exe memory leak on creating iframes
This morning, I observed an employee of a customer having this problem when she was using our add-in. What I could see is that each time a new iframe is opened, memory consumption of eowp.exe increased, but the memory is not released when the frame is closed again. We could easily reproduce the problem by repeatedly opening and closing the frame.

Not timely releasing resources is always a problem on a terminal server. Are there any settings that can improve this for eowp.exe?

EO.Base.Runtime.Shutdown
When experimenting on my development machine, I found that EO.Base.Runtime.Shutdown() immediately shuts down all started eowp.exe processes. This would be a great improvement in a terminal server environment, but it has a major problem: it seems impossible to again use a new webview once the engine was shutdown. I had expected that new eowp.exe processes would be created as needed, but that doesn't happen end the webview will not work again unless the host process is restarted.

I tried this, but it doesn't help:
Code: C#
if (EO.Base.Runtime.HasShutdown)
            EO.Base.Runtime.InitWorkerProcessExecutable(sEOWPExePath);


How is this supposed to work? I really would like to be able to shutdown and restart the engine.
eo_support
Posted: Thursday, January 30, 2020 9:14:04 PM
Rank: Administration
Groups: Administration

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

Thanks for posting in the forum. As to your questions:

1. eowp.exe memory usage

eowp.exe is used to run the native browser engine and the native browser engine's memory management is extremely complex, especially on the render side (that maintains the DHTML tree and hosts the JavaScript engine). Both the JavaScript engine and the DHTML tree use non-deterministic memory management and memory is only reclaimed when the garbage collector runs. So it's not possible to change this. If you must reclaim the memory deterministically, you will need to destroy the whole WebView instead;

2. EO.Base.Runtime.Shutdown

This is not reversible. If you wish to use this method, you should create a separate AppDomain, run WebView in that domain, shutdown, unload the domain. Then next time you wish to use WebView, you would use a new AppDomain. Obviously this is not recommended since using a new AppDomain every time is quite expensive. However it might work for plugin scenario when you wish to isolate EO.WebBrowser from other modules.

Hope this helps.

Thanks!
Erik R
Posted: Friday, January 31, 2020 2:39:36 AM
Rank: Newbie
Groups: Member

Joined: 4/15/2016
Posts: 3
Hi,

Thanks for your clear and fast reply. I have now changed my code so that the webview is explicitly destroyed on window close if the add-in is configured for low memory.
I have one additional question.

Question
When I create a single webview, a minimum of three eowp.exe instances are started:


When I destroy the webview, only the renderer instance is closed. Fortunately that is the one using by far the most memory, so explicit destruction is a major improvement in my situation.
Is there a way to also close the other instances or not have them created? For instance, I found that a fourth eowp.exe instance is created (and remains running) unless I set Runtime.DefaultEngineOptions.DisableGPU = true;. I'd be interested in similar settings.

Thanks,
eo_support
Posted: Friday, January 31, 2020 6:50:39 AM
Rank: Administration
Groups: Administration

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

Generally you do not need to worry about others. Chromium browser engine has a fairly complex multi-process architecture and most of them can not be turned off. Beside they were their for a purpose. For example, it runs all GPU related code inside the GPU process. If you disable GPU, then the GPU process won't start however some GPU sensitive features (such as WebGL) will see significant performance degradation. Generally you do not have to worry about these processes because:

1. Their life time is tied to the WebView object. If you destroy all WebView objects, then eventually all of them will exit;
2. The total amount of memory these process use are much less than the sum of each process uses adding up together. This is because these process shares large amount of data through shared memory;

Hope this helps.

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.