Welcome Guest Search | Active Topics | Sign In | Register

WebBrowser, remaining event handler after dispose Options
Eurice
Posted: Thursday, December 18, 2014 8:40:43 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Hello,

I'm using a memory profiler in order to see if my app is leaking memory; and I saw that closed EO Webview still have 2 events handler attached "GiveFocusEventHandler" and "WndMsgEventHandler" (please see attached screenshots).
I didn't attach those hander using webViewEO.GiveFocus += ... ; So I believe it is attached internally.

This occurs after :
-> create a webview
-> load a URL
-> close the webview
-> remove all handlers I previously attached exemple: webViewEO.LoadCompleted -= WebViewEO_OnLoadCompleted ...
-> call Destroy() and Dispose() methodes

I tested on the sample with the same result (see second screenshot).
I waited 1h to see if the garbage collector would wipe the remaining handlers but it didn't.


Thanks

MY APP :


EO SAMPLE :

eo_support
Posted: Thursday, December 18, 2014 10:40:17 AM
Rank: Administration
Groups: Administration

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

Please check the version of EO.WebBrowser.dll you use. We have recently fixed an issue related to memory usage.

The two event handlers are fine. The wrapper class WebControl does hook up to these two events. So these two handlers are not from you and they alone are not an issue. However something else still references the WebView even after you have disposed it might be an issue. Specifically in your case, the Dictionary<int, n, a> entry might be an issue. This is an internal global variable map that we use and the WebView should be removed from it after a while (it may not be removed immediately). So if you do not see it being removed or even grow in size over time, then that will be an issue.

The i() root node is normal. This represents an internal thread and it references a few local variables which indirectly references to a WebView. Those references will be released as the internal thread runs.

Thanks!
Eurice
Posted: Thursday, December 18, 2014 11:05:08 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Hi,

We are using 3.0.91.1, i'll keep testing and come back to you
eo_support
Posted: Thursday, December 18, 2014 11:07:26 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,068
No problem. Please keep us updated.

Thanks!
Matt Gerginski
Posted: Friday, December 19, 2014 3:47:50 PM
Rank: Newbie
Groups: Member

Joined: 12/19/2014
Posts: 2
I ran into this same issue using 3.0.86.0, but with the WinForms WebControl.

The solution was to also set WebControl.WebView=Nothing (or null, in C#) when cleaning up.

Hope this helps!
Eurice
Posted: Tuesday, December 23, 2014 6:24:56 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Hello,

I have done more test on the sample TabbedBrowser (with latest multi-dll build 3.0.95.1);
and it appears that after opening multiple tab (always pointing to google.com) and then closing them it.
Some webcontrol still remains in memory and the two event handlers are still attached (GiveFocusEventHandler & WndMsgEventHandler);
I tested for like 10' and the number of webcontrol retained in memory keep rising up as I open->load->close tabs


This is done on tabbedBrowser sample unmodified see attached picture :


Eurice
Posted: Monday, January 5, 2015 9:53:06 AM
Rank: Advanced Member
Groups: Member

Joined: 12/10/2014
Posts: 133
Any news on this ?

Thanks
eo_support
Posted: Tuesday, January 6, 2015 4:53:06 PM
Rank: Administration
Groups: Administration

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

There is no significant difference between the new image and the old image. The instances you see in the Dictionary<int, m, a> part will go away eventually after you keep loading new request. They will NOT go away if:

1. Within 5 minutes after the last request was loaded. For example, if you have loaded a page in a WebView, then this WebView will be kept for at least 5 minutes;
2. No further request has been loaded by any WebView. For example, if you have loaded a page in WebView a, then close it, then let the application sits idle, then this WebView will not be released no matter what. However if you load another request (regardless from which WebView) after 5 minutes, then the previous WebView will be released;

The minimum 5 minutes duration and the fact that we do not trigger object release unless there are new request can cause the false impression of that the WebView will never be released. However under a normal application environment where new requests are continuously being loaded the unused WebView will eventually be released.

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.