Potential Memory Leak

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Potential Memory Leak

Postby donovan » Wed Aug 27, 2014 11:11 am

We are currently using CEF and CEFGlue in a WinForms application. We are seeing some memory allocation issues and are trying to track down the source of the problem. Part of this research included creating an HTML page that easily replicated the memory issue. I have attached a png that is a screen shot of our test Html. It uses a meta refresh tag to tell the browser to refresh a lot. I realize, one would never use this in real life, but it is very useful is revealing the memory leak.

Our test procedure:
    Use our WinForms application with the test html page. Result: our client allocates about 1 gig of memory and the renderer process crashes
    Use the CefGlue.Client application with the test html page. Result: CefGlue.Client allocates about 1 gig of memory and continues to work for hours
    We determined that the CefGlue.Client application was on a slightly newer version of CEF than our Client, so we upgraded to the same version of CefGlue and CEF (currently using CefGlue version 3.0.0.0 and libcef.dll version (3.1916.1721.0) Result: our client allocates about 1 gig of memory and continues to work (it has only crashed 1 time out of 7) Update: As I have continued to do more testing, I noticed that the Xilium CefGlue Demo (WinForms) app, seems to recycle memory (i.e. allocates about a 1 gig and then frees a bunch of that memory and starts over)
    Use the Cef test client (version 3.1916.1721) with the test html page. Result: it allocates some memory and then frees it, repeat for a long period of time. It never allocated more than 100 meg of memory and never crashes (after hours of running).

Our conclusion from this experiment is that CefGlue is struggling with freeing the memory allocated by the renderer process. It seems like the code did improve with the move to 1916.1721, however there still seems to be some issues. Does anyone have any insight into this issue? Thanks in advance.

Update:Given that the Xilium winforms demo app recycles memory, I would assume we are not doing something we should be doing in our application, but it does seem like the CefGlue wrapper is struggling with the memory allocation.
Donovan
Attachments
index.png
Memory Leak Test Html File
index.png (30.39 KiB) Viewed 7399 times
donovan
Newbie
 
Posts: 2
Joined: Wed Aug 27, 2014 10:48 am

Re: Potential Memory Leak

Postby donovan » Thu Aug 28, 2014 5:29 pm

Found a solution. It turns out we copied part of the DemoRenderProcessHandler class from the CefGlue.Demo.Renderer folder when we created our application. The specific code that was causing the memory issues is the OnProcessMessageReceived method. Once that was removed, everything behaved normally again. This is why we saw the issue with our client as well as with the CefGlue.Demo project.

Donovan
donovan
Newbie
 
Posts: 2
Joined: Wed Aug 27, 2014 10:48 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 21 guests