Debugging Memory leak in CEF v83

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Debugging Memory leak in CEF v83

Postby mzboray » Mon Feb 22, 2021 11:05 pm

I'm using CEF in an offscreen capacity via CefSharp bindings in a C# application, specifically the CefSharp.Offscreen nuget package. I have a user reporting that the application is causing rather rapid memory consumption on startup, using all available memory on a machine with 16 GB RAM, within 20s of startup. I don't have all the details but I do have a full memory dump. One thing I can tell is that the managed heap is fairly small, less than a few tens of MB but the unmanaged heaps are very large as reported in windbg. Is there any way for me to diagnose the issue further from this? I haven't been able to reproduce it other than this report from the user who says it happens very repeatably on their system. AFAIK at this point in the app all that has happened is that it has called Cef.Initialize. No requests have been made to navigate to a page yet.

A few details from WinDbg:
0:000> !heap -s
************************************************************************************************************************
NT HEAP STATS BELOW
************************************************************************************************************************
LFH Key : 0xc4742990fab48b35
Termination on corruption : ENABLED
Heap Flags Reserv Commit Virt Free List UCR Virt Lock Fast
(k) (k) (k) (k) length blocks cont. heap
-------------------------------------------------------------------------------------
00000241f52a0000 00000002 8280 6076 8176 69 123 4 1 0 LFH
00000241f5150000 00008000 64 4 64 2 1 1 0 0
00000241f5160000 00001002 164 64 60 5 6 1 0 0 LFH
00000241f5520000 00001002 1184 192 1080 6 5 2 0 0 LFH
00000241f5950000 00001002 1184 104 1080 7 5 2 0 0 LFH
00000241f5910000 00041002 60 8 60 5 1 1 0 0
00000241f6170000 00041002 1080 236 1080 7 3 2 0 0
00000241f6770000 00001002 60 20 60 8 2 1 0 0
00000241f6730000 00001002 1184 88 1080 15 4 2 0 0 LFH
00000241f7390000 00001002 60 8 60 5 1 1 0 0
00000241f7520000 00001002 16316824 16284476 16316720 46390 1060 1012 1 3 LFH
-------------------------------------------------------------------------------------
0:000> !heap -stat -h 00000241f7520000
heap @ 00000241f7520000
group-by: TOTSIZE max-display: 20
size #blocks total ( %) (percent of total busy bytes)
20 bc650eb - 178ca1d60 (53.30)
60 1f66294 - bc64f780 (26.65)
40 1f66835 - 7d9a0d40 (17.77)
10000000 1 - 10000000 (2.26)
30 e7e - 2b7a0 (0.00)
58 596 - 1eb90 (0.00)

Some further details:
Windows 10 (not sure the exact version) 64-bit process
CefSharp v83.4.20 (uses CEF 83.4.2+gc8d4f85+chromium-83.0.4103.106 / Chromium 83.0.4103.106)
mzboray
Newbie
 
Posts: 8
Joined: Wed Jul 08, 2020 6:52 pm

Re: Debugging Memory leak in CEF v83

Postby amaitland » Wed Feb 24, 2021 10:42 pm

Have you checked the CEF issue tracker? From memory there's a similar sounding report (or two).

Can you test with version 88? There's little point in debugging version 83 unless you plan to build/patch your own CEF version.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 1 guest