wpf: High memory consumption or memory leak on Intel integrated graphics

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.

3aedc63e2047a93783dd15d5ac35848

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

1ea5fdd519f495d74ada897df20fedb

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.

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

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

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 6
  • Comments: 17 (3 by maintainers)

Most upvoted comments

We are currently following with the DirectX team internally for this bug. It looks like there is an issue with D3D9On12 abstraction which is causing the spike in memory usage.

We will update you as soon as we know more.

We have the same issue on a few recent Dell Laptops with 12th Gen Intel CPUs. In our case (32bit application) it leads to OutOfMemory and other exceptions in strange places.

Same issue here.

Hardware:

  • Intel Core i7-12800H
  • Intel Iris Xe Graphics G7 96EUs

Software:

  • Windows 10 Pro 22H2
  • VS2022 .net6 or .net7 WPF application
  • Driver Intel UHD Graphics 31.0.101.4255

The workaround solution mentioned to use software rendering works indeed, but is not preferred.

i can confirm this issue happens with my 12th Gen Intel CPU 12500 with integrated GPU 770, i created an empty wpf app, can confirm it consumes 100mb more memory in task manager. Snipaste_2023-07-18_14-01-56

I am also confused about this issue. It is difficult to understand why a simple Net6.0 WPF application would result in such high memory consumption.

Here is some additional information. I hope this issue can be resolved. WPF Task Manager

Dxdiag Info

Memory consumption of a Fullscreen WPF application on a 4K UHD Display + Intel GPU is insane. Using Software rendering fixes the issues, but we would prefer a better solution.

Our telemetrics currently shows a lot of OutOfMemory and RenderThreadFailure Exceptions and the majority of our target devices are using these gpus. Hope this will be fixed soon.

The problems are so obviously! - (and after 2 hours of research you can see that the problem comes at the time when microsoft changes the concept to the new wrapper D3D9On12). I can’t understand why microsoft or/and intel ignores this bug. Many user have this problem since over one year !

I see the same happening on a Dell All-in-One with the Intel Iris Xe Graphics hardware.

Operating System: Microsoft Windows 11 Home 10.0.22621
IGCC Version: 1.100.5237.0
Language: en-US
Physical Memory: 63.7 GB 
Current Resolution: 1920x1080

Processor: 12th Gen Intel(R) Core(TM) i7-1255U
Processor Speed: 1700 MHz
GFX Driver Name: Intel® Iris® Xe Graphics
Shader Version: 5.1
OpenCL* Version: 3.0
* Microsoft DirectX* *
Runtime Version: 12
Hardware-Supported Version: 12
Vendor ID: 8086
Device ID: 46A8
Device Revision: 0C
GFX Driver Version: 31.0.101.4502
Dedicated RAM: 128 MB
Shared RAM: 32 GB
Max Supported Displays: 4
GFX Vulcan: 1.3.250
GFX GOP: 21.0.1046

The project is a new WPF .NET 6 with no modifications. image

and with

RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;

image

We have the same problem Out of memory issues with our WPF based software. At both x32 and x64 builds, .NET 4.8.

Device specs: image

image

Test WpfApp consumes abnormal 345 MB
image

The problem is happening to me too

image

image

image

image

@Anduin2017 You are using NVIDIA GPU, so you don’t have this issue. It only happens to a few Intel CPU with integrated GPU.