C#Windows应用程序内存 [英] C# Windows Application Memory

查看:89
本文介绍了C#Windows应用程序内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,希望有人能帮忙...

我有一个实例化一个类的程序,该类返回带有多个控件的控件.

我遇到的问题是,当我处理并调用GC.Collect()时,任务管理器中的内存不会丢失.这是一个问题,因为我的应用程序的内存很大,并且计算机开始滞后.谁能帮忙吗?


感谢

Hi guys hope someone can be of assistance...

I have a program that instantiate a class which returns a control with multiple controls on.

The problem that I have is that when I dispose and call The GC.Collect() my memory in Task Manager doesn''t drop. This is a problem because my application''s memory gets huge and the computer starts to lag. Can anyone please assist??


Thanks

推荐答案

内存增长和垃圾回收不起作用,表明您正在使对象引用保持活动状态.这可能很难找到,但是很可能使用控件的表单一直处于活动状态而不是关闭.
Memory growth and garbage collection not working indicates you are keeping the object references alive. This can be hard to find, but most likely the form using your controls are being kept alive and not closing.


但是表单
需要保持运行状态,否则程序将需要重新启动,这是我不希望的.
But the form
that runs needs to be kept alive otherwise the program will need to restarted which I dont want.


这篇关于C#Windows应用程序内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆