垃圾收集器使用托管堆和根来创建对象garph [英] Garbage collector makes a object garph using managed heap and Roots

查看:137
本文介绍了垃圾收集器使用托管堆和根来创建对象garph的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当垃圾收集器开始运行时,它会假设堆中的所有对象都是垃圾。换句话说,它假定应用程序的根中没有一个引用堆中的任何对象。现在,垃圾收集器开始遍历根并构建一个可以从根到达的所有对象的图形。



整个过程的根源是什么?

When the garbage collector starts running, it makes the assumption that all objects in the heap are garbage. In other words, it assumes that none of the application's roots refer to any objects in the heap. Now, the garbage collector starts walking the roots and building a graph of all objects reachable from the roots.

What are the roots in this whole process???

推荐答案

我不确定你在哪里阅读,但我会仔细阅读所有这些主题,以便你可以完全理解.NET垃圾收集:



MSDN .NET垃圾收集 [ ^ ]



如果您没有全部阅读,请至少阅读以下内容:



< a href =http://msdn.microsoft.com/en-us/library/ee787088(v=vs.110).aspx> .NET Garbage Collection Fundamentals [ ^ ]
I'm not sure where you read that, but I would go through all these topics so you can fully understand .NET Garbage Collection:

MSDN .NET Garbage Collection[^]

If you don't read them all, at least read this one:

.NET Garbage Collection Fundamentals[^]


这篇关于垃圾收集器使用托管堆和根来创建对象garph的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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