开发者

.Net 4 Garbage Collection

开发者 https://www.devze.com 2023-04-03 13:27 出处:网络
I tried to read up garbage collection algorithms in Java and in .Net recently. So far I found out that java uses Mark and Sweep as algorithm within its collectors.

I tried to read up garbage collection algorithms in Java and in .Net recently. So far I found out that java uses Mark and Sweep as algorithm within its collectors.

Is .Net using Mark and sweep as well on all the generations?

How did Micros开发者_如何学Coft moved from concurrent G0, G1 collector, running SERIALLY with G@ collector, to a sth called BACKGROUND GC, where everything is parallel?

Thanks in advance for your answers.


.NET GC is a mark and sweep garbage collector. Background GC means that you can perform Gen2 GCs while your application is running. If your application is allocation intensive, and the background GC can't free up enough space for the new allocation, the BGC collector is stopped, and a stop-the-world collector is used to do a full Gen2 GC (which could result in compacting the heap, or expanding it)

Hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消