High memory consumption or memory leak on Intel integrated graphics
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
WPF application running on some Intel integrated graphics card is taking a lot more memory than it should. Even a pure empty WPF app takes 165.2 MB on startup.

On other machine without Intel graphics, or disabling intel graphics card, or use software rendering, the memory consumption is normal.

There are two threads on Intel community site describing the same issue. But I am not sure if this is a WPF issue or Intel issue.
https://community.intel.com/t5/Graphics/Net-WPF-Application-high-memory-consumption/td-p/1434020
https://community.intel.com/t5/Graphics/UHD710-High-memory-usage-and-memory-leak-issues-with-WPF/m-p/1471504
### Reproduction Steps
- Prepare a computer with i9-13900H CPU with Iris XE graphics (Other intel graphic may also have the issue)
- Install latest RTM driver 31.0.101.4255
- (Or) install latest beta driver 31.0.101.4257
- (Or) install old driver 31.0.101.4032 / 31.0.101.4091
- Create an empty WPF application with VS2022, .NET 6.0 or 7.0
- Publish the application using Release build
- Run the application
- Observe memory usage in task manager
### Expected behavior
Memory usage is around 10-30 MB
### Actual behavior
Memory usage is around 150 MB
### Regression?
_No response_
### Known Workarounds
Set the WPF app to use software rendering.
```csharp
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
}
}
```
### Impact
Users with some type of Intel graphics will have much more memory usage and potentially slow down their system.
### Configuration
- .NET 6.0 / 7.0
- Windows 11 Pro 22621.1485 x64
### Other information
#### This issue does not happen to
- i7-1185G7 with Intel Iris Xe Graphics (e.g. Surface Pro 8)
- i7-1065G7 with Intel lris Plus Graphics (e.g. Surface Laptop 3, Driver version 27.20.100.9621)
- i7-10700T with Intel UHD 630 Graphics (Driver version 31.0.101.2114)
- i7-8665U with Intel UHD 620 Graphics (Driver version 30.0.101.1404)
#### Attaching the WPF app used for testing this
[WpfApp1.zip](https://github.com/dotnet/wpf/files/11195882/WpfApp1.zip)
#### Memory consumption also has something to do with monitors:
- Using laptop screen only or just one external monitor: ~95MB (which is still considered to be abnormal)
- Using two external monitors: ~160MB
- Using laptop screen + two external monitors: ~245MB
It doesn't matter which screen the App is on, the more screens, the more memory usage.
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.