Higher RAM usage in NETCore
- Dominant language
- C#
- Stars
- 10.3k
- Forks
- 2.9k
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 4
Description
### Is there an existing issue for this?
- [X] I have searched both open/closed issues, no issue already exists.
### CefSharp Version
120.2.50
### Operating System
Windows 11
### Architecture
x86
### .Net Version
.NET 6.0
### Implementation
WinForms
### Reproduction Steps
Create minimal application that uses CefSharp and build it both for .NET Framework and .NET Core.
### Expected behavior
Both versions should take a similar amount of RAM.
### Actual behavior
There's a 20-30% difference between the two versions' working set.
See this table (taken from Process Explorer):
.NET 6:
| Process name | Private Bytes | Working Set |
|--------|--------|--------|
| Chromium.exe | 37,292 K | 99,908 K |
| CefSharp.BrowserSubprocess.exe | 101,244 K | 85,808 K |
| CefSharp.BrowserSubprocess.exe | 21,888 K | 34,820 K |
| CefSharp.BrowserSubprocess.exe | 23,264 K | 42,092 K |
| CefSharp.BrowserSubprocess.exe | 25,764 K | 43,848 K |
| CefSharp.BrowserSubprocess.exe | 28,040 K | 58,440 K |
.NET 4.7.2:
| Process name | Private Bytes | Working Set |
|--------|--------|--------|
| Chromium.exe | 35,532 K | 80,800 K |
| CefSharp.BrowserSubprocess.exe | 103,972 K | 75,220 K |
| CefSharp.BrowserSubprocess.exe | 21,380 K | 32,504 K |
| CefSharp.BrowserSubprocess.exe | 20,404 K | 25,964 K |
| CefSharp.BrowserSubprocess.exe | 24,264 K | 34,704 K |
| CefSharp.BrowserSubprocess.exe | 26,220 K | 48,696 K |
This increases even further when I actually start browsing in either program.
### Regression?
_No response_
### Known Workarounds
_No response_
### Does this problem also occur in the CEF Sample Application
Not Tested
### Other information
_No response_
Contributor guide
Research direction
Start by reproducing the reported minimal CefSharp WinForms application on Windows 11 x86 with .NET 6.0 and .NET Framework 4.7.2. Use Process Explorer to compare Chromium.exe and CefSharp.BrowserSubprocess.exe private bytes and working sets before and during browsing. Done means identifying the cause of the 20–30% difference and bringing the runtimes' memory usage to a similar level, or documenting a confirmed runtime limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100