惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
D
Darknet – Hacking Tools, Hacker News & Cyber Security
SecWiki News
SecWiki News
Latest news
Latest news
A
Arctic Wolf
Know Your Adversary
Know Your Adversary
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
T
Tor Project blog
T
Threatpost
S
Schneier on Security
P
Palo Alto Networks Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
C
CERT Recently Published Vulnerability Notes
博客园_首页
P
Privacy & Cybersecurity Law Blog
I
Intezer
PCI Perspectives
PCI Perspectives
Spread Privacy
Spread Privacy
G
Google Developers Blog
H
Help Net Security
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
U
Unit 42
Application and Cybersecurity Blog
Application and Cybersecurity Blog
W
WeLiveSecurity
D
DataBreaches.Net
N
News and Events Feed by Topic
AI
AI
The Register - Security
The Register - Security
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Help Net Security
Help Net Security
K
Kaspersky official blog
Recent Announcements
Recent Announcements
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security @ Cisco Blogs
H
Hacker News: Front Page
Jina AI
Jina AI
S
Secure Thoughts
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
爱范儿
爱范儿

博客园 - lbq1221119

时间同步算法与Simple Ring-based election algorithm算法分析 SSCLI中GC垃圾回收源码分析(2) - GarbageCollect()与Spin Lock SSCLI中GC源码分析(1) - EE与BCL之间的调用接口FCall (北京宇思信德科技公司)诚聘C#软件工程师 , Middle及Senior Level .Net Micro framework在开发过程中的bugs/problems及解决方案。 MF中使用GPRS:如何通过一个串口终端实现GPRS Modem拨号上网 博客园北京俱乐部第三次活动讲义PPT ValueType.Equals(null)的底层实现及CLR虚拟机对其结构支持 WebService传输数据流及数据交互解析 托管线程退出之后Dump文件特征 国外精品研究论文(持续更新) Random()中具体实现(含种子数组的实现) From double Click to Main: PAL initialization - lbq1221119 From double Click to Main: The initialization of Process in OS Microsoft Micro Framework 3.0对Serial Peripheral Interface 的支持 使用CorDbg进行托管调试 CLR内核调试之:Malloc函数实现 Build SSCLI20 under VS2008 full Document (完全手册) MethodTable内存空间分配中加法运算算法解析
SSCLI中GC垃圾回收源码分析(3) - GarbageCollectGeneration()与SuspendEE
lbq1221119 · 2009-09-14 · via 博客园 - lbq1221119

上一节中的GarbageCollect()方法,主要是传递不同的Generation做为参数,来调用GarbageCollectGeneration方法,实现对heap中不同的Generation进行回收。

精简了以后的GarbageCollectGeneration方法以后的代码如下:

image

在第一次调用该方法的时候,Gen传递过来的参数值为max_generation,表示对GC Heap中所有Generation进行垃圾回收。从上面的代码中可以看到,在对指定的代进行回收的时候,首先Suspend住了Execute Engine。然后调用对第一代Generation进行回收的方法:

gc_heap::garbage_collect(condemned_generation_number);

在这个回收的过程中,可能会产生异常失败,这里用了一个goto语句来进行重试。在完成了回收之后,重新启动Runtime EE。同时,暂停住EE也可以使在后面根据定义的一组Root来寻找live object的时候更加的安全和迅速。

这里,考虑是不是加入Execute Engine启动和暂停的控制…