.NET中的垃圾回收 [英] Garbage Collection in .net

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

问题描述


1.判断应用程序是否在进程A中运行.现在CLR在同一进程中运行垃圾回收,或者在单独的进程中运行.

2.什么时候抛出Memoryoutofexception.

Hi,
1. say if an application is running in aprocess A. Now the CLR runs the garbage collection in the same process or it runs in the seperate process.

2. When does the Memoryoutofexception is thrown.
Is there any chance that G2 is completely filled and G0 and G1 are partially filled and pushing the new objects into G2 slot will thrown an out of memory exception.

推荐答案

1 . GC在您的过程中运行.它是CLR的一部分,用于运行代码,收集对象,因此它必须在您的进程中运行.

2.这可能是由于堆被耗尽,或者是大对象堆中的内存碎片所致,或者您可以通过在处理完对象后不适当地处置它们来耗尽Windows处理池.
1. The GC runs in your process. It''s part of the CLR that''s running your code, collecting your objects, so it has to run in your process.

2. It can be caused by the heap being exhausted, or by memory fragmentation in the large object heap, or you can exhaust the Windows handle pool by not properly disposing objects when you''re done with them.


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

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