问题解决一:
如果是窗体属性加载了背景图导致的内存占用,在关闭窗体前,释放掉背景图资源即可释放占用的内存
private Image backgroundImage; public Form2() { InitializeComponent(); backgroundImage = Image.FromFile(@"D:\XXXX.png"); //图片路径 this.BackgroundImage = backgroundImage; this.BackgroundImageLayout = ImageLayout.Stretch; } protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); // 释放图片资源 if (backgroundImage != null) { backgroundImage.Dispose(); backgroundImage = null; } }
标签:释放,OnFormClosing,C#,backgroundImage,内存,null,背景图,winform From: https://www.cnblogs.com/blossomwei/p/18098173