dotnet / dotnet/wpf

WPF consumes lots of memory on ARM window

Open
#8,306 3 comments 3 reactions 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

WPF consumes lots of memory on ARM-windows.
When I call `win.Show()` to display the first main window, .NET's memory usage increases from a few megabytes to 100mb.

### Reproduction Steps

```
PS C:\Users\k1mlk\source> dotnet --version
8.0.100-rc.2.23502.2
PS C:\Users\k1mlk\source> dotnet new wpf -o BlankWpf
PS C:\Users\k1mlk\source> cd .\BlankWpf\
PS C:\Users\k1mlk\source\BlankWpf> dotnet run -c Release
```

### Expected behavior

I hope it can take a normal level memory usage like x86 (A blank window less than 20mb)

### Actual behavior

![image](https://github.com/dotnet/wpf/assets/28323948/f2cda9a8-0a96-4df3-8ae1-e947d93d8038)
The wpf take more than 100MB memory in Task Manager

### Other information

There is my system information
```
Host: DEVKIT-ARM
OS Name: Microsoft Windows 11 Pro
OS Version: 10.0.22621 N/A build 22621
System Model: Windows Dev Kit 2023
System Type: ARM64-based PC
Processor: 1 processor installed.
[01]: ARMv8 (64-bit) Family 8 Model D4B Revision 0 Qualcomm Technologies Inc ~2995 Mhz
Total Physical Memory: 32,165 MB
Available Physical Memory: 22,993 MB
Virtual Memory: Maximum Size: 34,213 MB
Virtual Memory: Available: 25,415 MB
Virtual Memory: In Use: 8,798 MB
Hyper-V Requirements: Hyper-V hypervisor is detected. Necessary features for Hyper-V are not displayed.
```

If I compile an x64 version and run it on the computer, everything appears to be normal.

And I think this happens to .net framework 4.8.1 arm64 too.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.