Use PropertyGrid in WPF, the memory increased from 63M to 4.5G
See original GitHub issue-
.NET Core Version: 5.0.202
-
Have you experienced this same bug with .NET Framework?: No
Problem description: when i am use propertygrid in wpf, if set the SelectedObject, the memory increase from 63M to 4.5G
The Xaml Like this
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
xmlns:local1="clr-namespace:WpfCustomControlLibrary1;assembly=WpfCustomControlLibrary1"
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded">
<DockPanel>
<ComboBox DockPanel.Dock="Top" ItemsSource="{Binding ObjectItems}" SelectedIndex="{Binding SelectedIndex}"/>
<WindowsFormsHost>
<winForms:PropertyGrid x:Name="propertyGrid" PropertySort="Categorized" Dock="Fill"/>
</WindowsFormsHost>
</DockPanel>
</Window>
The CS Code Like This:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.propertyGrid.SelectedObject = new System.Windows.Forms.Button();
}
}
Expected behavior:
Minimal repro:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Running on .NET Core / .NET 5.0 exhibits huge memory ...
NET 5.0 exhibits huge memory leak when resizing, and uses alot more ... Use PropertyGrid in WPF, the memory increased from 63M to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i have resolved this problem, Update the Visual Studio To 16.9.5, One Previous Version is 16.9.4,and anthor version is 16.8.2. i think this problem is because of roslyn。
显示器:24寸,屏幕分辨率:1920*1080
------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年5月14日(星期五) 上午8:32 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [dotnet/wpf] Use PropertyGrid in WPF, the memory increased from 63M to 4.5G (#4504)
@dupeng0224 what is your screen resolution?
你的屏幕有多大呢?屏幕分辨率多少呢?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.