诸如cleanmem之类的程序如何工作? [英] How do programs like cleanmem work?

查看:96
本文介绍了诸如cleanmem之类的程序如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不是编程问题,但我想了解此类程序背后的理论.有一个名为Cleanmem的程序 http://www.pcwintech.com/cleanmem [状态时会释放内存.我想在我的程序中实现这样的功能,以便它在一段时间后释放内存.我在Visual Studio 2005上使用C#开发应用程序.

This is not a programming question, but i want to know the theory behind such programs. There is a program called Cleanmem http://www.pcwintech.com/cleanmem[^] which automatically releases memory on schedule. Cleanmem author talks about using Windows API to achieve this. But i don''t get it. How do they release memory automatically when memory reaches certain limit? In windows, some applications release memory when they are in "Minimized" state. I would want to implement such in my programs so that it releases memory itself after some time. I develop applications using C# on visual studio 2005.

推荐答案

在C#中,您可以通过在提供它的对象上调用Dispose释放内存和资源,也许还可以通过强制垃圾来释放内存和资源.收集器运行,除非您的应用中有很多大文件(也许是视频或图像),否则就不需要这样做.
In C#, you release memory and resources by calling Dispose on objects that offer it, and perhaps from forcing the garbage collector to run, which you should not need to do unless you have a lot of big files in your app ( videos or images perhaps )


这篇关于诸如cleanmem之类的程序如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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