垃圾收集的要求? [英] Garbage collection request?

查看:157
本文介绍了垃圾收集的要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道,在运行时的垃圾回收请求时自动没有足够的内存空间,以形成对象。在我的知识垃圾收集自动调用,但是当我们在现实世界中的一些节目则成为indespensible调用垃圾collection.let一个例子,如果我们做的第一步PROGRAMM我想打电话给垃圾收集进一步建立优化内存对象的运行时间期间意思。因此,我们将如何调用垃圾收集器?

As we know that during run time garbage collection request automatically when there is not enough space in memory to forming object. In my knowledge garbage collection call automatically, but when we do some programming in real world then it become indespensible to call garbage collection.let a example if we are making a programm in first step i want to call garbage collection for optimizing memory for further creation of object that means during run time. So how we will call garbage collector ?

推荐答案

一般来说,你应该的不可以调用GC.Collect自己。在GC是可以自行调整,将最有可能做一个更好的工作比你可以,因为它可以考虑到整个托管堆及其用法。

Generally you should not call GC.Collect yourself. The GC is self-tuning and will most likely do a much better job than you can as it can take account of the entire managed heap and its usage.

不过,您可能要检查的答案这个问题为好。

However, you may want to check the answers to this question as well.

这篇关于垃圾收集的要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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