v8 crash, Allocation failed - process out of memory ?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: v8 crash, Allocation failed - process out of memory ?

Postby tom » Fri Jan 22, 2010 12:27 pm

As I am getting this problem as well has anyone got any ideas. I really need to use V8.

Many Thanks

Tom
tom
Techie
 
Posts: 12
Joined: Thu Nov 05, 2009 10:05 am

Re: v8 crash, Allocation failed - process out of memory ?

Postby magreenblatt » Fri Jan 29, 2010 10:08 am

Hi Tom,

Are all of the CefV8Value objects being cleaned up properly? If you're running in debug mode you'll hit an assert in cef_shutdown() if they aren't.

Is it possible to reduce your usage case to a V8-only test case? If so, that may be a good starting point for identifying whether the problem is a V8-only memory issue (perhaps something wrong with the JS) or a CEF-related issue. This current thread on chromium-dev includes instructions on how to debug memory issues with V8: http://groups.google.com/a/chromium.org ... 40331cb208

Regards,
Marshall
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: v8 crash, Allocation failed - process out of memory ?

Postby tom » Fri Jan 29, 2010 12:38 pm

I got over this problem by using the other way of doing JavaScript funtions

like so void InitExtensionTest()
{
// Register a V8 extension with the below JavaScript code that calls native
// methods implemented in ClientV8ExtensionHandler.
std::wstring code = L"var cef;"
L"if (!cef)"
L" cef = {};"
L"if (!cef.test)"
L" cef.test = {};"
L"(function() {"
L" cef.test.__defineGetter__('test_param', function() {"
L" native function GetTestParam();"
L" return GetTestParam();"
L" });"
L" cef.test.__defineSetter__('test_param', function(b) {"
L" native function SetTestParam();"
L" if(b) SetTestParam(b);"
L" });"
L" cef.test.test_object = function() {"
L" native function GetTestObject();"
L" return GetTestObject();"
L" };"
L"})();";
CefRegisterExtension(L"v8/test", code, new ClientV8ExtensionHandler());
}

That stop the memory going up allot and halved the memory usage.


However the memory of cef_client is just going up and up even if I don't have any plug ins or anything special.
In the end it cef_clients crashes and runs out of memory.

I have tried test_shell and that doesn't have the problem the memory levels out after a while (around 60mb).
I did have the test_shell crash in HistoryController.cpp after a while so I had to fix that.


As I have said I have remove all the special code out of the cef_client to make it the same as test_shell but the memory is still going up.

Any Ideas? I have spent days on this and we have to fix the problem.

Many Thanks

Tom
tom
Techie
 
Posts: 12
Joined: Thu Nov 05, 2009 10:05 am

Re: v8 crash, Allocation failed - process out of memory ?

Postby heshiming » Fri Jan 29, 2010 8:38 pm

When I tried to identify the cause of this problem, I also compared CEF to test_shell.

I think test_shell has some level of memory leak too. One time, I left it on continuing navigation for overnight, and the next day I'm seeing like 100MB process memory. It's not that bad, but it's still leaking.

As I previously said by disabling the V8 function extension registration completely, I was able to get CEF stay at roughly test_shell's size. In testing, I used a simple scheme handler. I suggest you do the same. If you are seeing obvious memory leaks without v8 extension registration, it's probably your own code.

I think at least now, you probably shouldn't use v8 extension. Back then I traced all CEF v8 objects (including CefV8Value), and found all of them properly destructed. So the leak is inside WebKit or its WebCore. Or, extra cleanup is required for WebKit before registering an extension upon page load, not sure what it was though.
heshiming
Techie
 
Posts: 29
Joined: Fri Jul 31, 2009 1:59 am

Re: v8 crash, Allocation failed - process out of memory ?

Postby tom » Sat Jan 30, 2010 5:18 am

I think there is two problem one is with v8 which I think I have a workaround and the other is with webkit.


I will do some more investigation and let you know.

Tom
tom
Techie
 
Posts: 12
Joined: Thu Nov 05, 2009 10:05 am

Re: v8 crash, Allocation failed - process out of memory ?

Postby magreenblatt » Sat Feb 20, 2010 11:34 pm

I will be removing the CefBrowser::HandleJSBinding() method in the near future. The announcement here: viewtopic.php?f=4&t=93
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: v8 crash, Allocation failed - process out of memory ?

Postby magreenblatt » Wed Apr 07, 2010 10:23 am

The CefHandler::HandleJSBinding() method has been eliminated in revision 73.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: v8 crash, Allocation failed - process out of memory ?

Postby carlosb007 » Thu Apr 08, 2010 4:43 am

Thanks for fixing this problem! Any chance of having the binary distribution of the latest revision available for download and saving the pain of trying to compile it ourselves? :)
carlosb007
Newbie
 
Posts: 9
Joined: Thu Apr 01, 2010 2:50 am

Re: v8 crash, Allocation failed - process out of memory ?

Postby magreenblatt » Thu Apr 08, 2010 8:54 am

A binary distribution at revision 76 is now available from the project downloads page.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Previous

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 20 guests

cron