在asp.net中手动gc.Collect() [英] gc.Collect() manually in asp.net

查看:88
本文介绍了在asp.net中手动gc.Collect()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们什么时候应该在asp.net中手动调用gc.Collect()?
预先感谢.

When should we call gc.Collect() manually in asp.net ???
Thanks in advance.

推荐答案

http://blogs.msdn.com/b/ricom/archive/2004/11/29/271829.aspx[^]

You can google for more.


检查这些链接

http://blogs.msdn.com/b/ricom/archive/2004/11/29/271829.aspx [ ^ ]

http://www.velocityreviews. com/forums/t106953-do-i-need-to-use-gc-collect-if-yes-where.html [ http://madskristensen.net/post/Calling-GCCollect-from-ASPNET.aspx [ ^ ]
Check these links

http://blogs.msdn.com/b/ricom/archive/2004/11/29/271829.aspx[^]

http://www.velocityreviews.com/forums/t106953-do-i-need-to-use-gc-collect-if-yes-where.html[^]

http://madskristensen.net/post/Calling-GCCollect-from-ASPNET.aspx[^]


我建​​议不要使用GC( http://msdn.microsoft.com/en -us/library/system.gc.aspx [非常好的理由,否则请不要使用.通常,垃圾收集器可以很好地工作,而无需调用GC.

当您问这个问题时,您当然不是很了解并了解如何以及为何明确使用GC的人.结论:您不应该这样做.

—SA
I recommend not to use GC (http://msdn.microsoft.com/en-us/library/system.gc.aspx[^]) at all unless you understand very well how Garbage Collector works and find a really good reason to use it. Normally, Garbage Collector works quite well without any calls to GC.

As you''re asking this question, you''re certainly not the one who understand it so well and get an idea how and why to use GC explicitly. Conclusion: you should not do it.

—SA


这篇关于在asp.net中手动gc.Collect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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