Files
note4cs/技术/Go/GC.md
2025-03-25 17:59:53 +08:00

11 lines
2.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Golang在GC的演进过程中也经历了很多次变革Go V1.3之前的[标记-清除](https://zhida.zhihu.com/search?content_id=238158259&content_type=Article&match_order=1&q=%E6%A0%87%E8%AE%B0-%E6%B8%85%E9%99%A4&zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NDI3OTg1ODcsInEiOiLmoIforrAt5riF6ZmkIiwiemhpZGFfc291cmNlIjoiZW50aXR5IiwiY29udGVudF9pZCI6MjM4MTU4MjU5LCJjb250ZW50X3R5cGUiOiJBcnRpY2xlIiwibWF0Y2hfb3JkZXIiOjEsInpkX3Rva2VuIjpudWxsfQ.L519Jm1YZEEQ1wuzajxX2OOBhbTH7DbPZHy8nn6Obns&zhida_source=entity)(mark and sweep)算法。Go V1.3之前的标记-清扫(mark and sweep)的缺点。
大家可以重点关注以下版本的变化:
- Go V1.5的[三色并发标记法](https://zhida.zhihu.com/search?content_id=238158259&content_type=Article&match_order=1&q=%E4%B8%89%E8%89%B2%E5%B9%B6%E5%8F%91%E6%A0%87%E8%AE%B0%E6%B3%95&zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NDI3OTg1ODcsInEiOiLkuInoibLlubblj5HmoIforrDms5UiLCJ6aGlkYV9zb3VyY2UiOiJlbnRpdHkiLCJjb250ZW50X2lkIjoyMzgxNTgyNTksImNvbnRlbnRfdHlwZSI6IkFydGljbGUiLCJtYXRjaF9vcmRlciI6MSwiemRfdG9rZW4iOm51bGx9.uWrIm2OB1_oK7lijlD4chkrpuqwtlbJ3MTtVKVst36c&zhida_source=entity)
- Go V1.5的三色标记为什么需要STW
- Go V1.5的三色标记为什么需要[屏障机制](https://zhida.zhihu.com/search?content_id=238158259&content_type=Article&match_order=1&q=%E5%B1%8F%E9%9A%9C%E6%9C%BA%E5%88%B6&zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NDI3OTg1ODcsInEiOiLlsY_pmpzmnLrliLYiLCJ6aGlkYV9zb3VyY2UiOiJlbnRpdHkiLCJjb250ZW50X2lkIjoyMzgxNTgyNTksImNvbnRlbnRfdHlwZSI6IkFydGljbGUiLCJtYXRjaF9vcmRlciI6MSwiemRfdG9rZW4iOm51bGx9.z_KFIcdz9agqmRw6oF9lyMLd_pCuwW8t9F3iG5Rf264&zhida_source=entity)(“强-弱” 三色不变式、插入屏障、删除屏障 )
- Go V1.8[混合写屏障](https://zhida.zhihu.com/search?content_id=238158259&content_type=Article&match_order=1&q=%E6%B7%B7%E5%90%88%E5%86%99%E5%B1%8F%E9%9A%9C&zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NDI3OTg1ODcsInEiOiLmt7flkIjlhpnlsY_pmpwiLCJ6aGlkYV9zb3VyY2UiOiJlbnRpdHkiLCJjb250ZW50X2lkIjoyMzgxNTgyNTksImNvbnRlbnRfdHlwZSI6IkFydGljbGUiLCJtYXRjaF9vcmRlciI6MSwiemRfdG9rZW4iOm51bGx9.bbCbV48D0n6tpBTp3s-Ia-MV3I-tnPAEhS6Bg1JVFog&zhida_source=entity)机制
- Go V1.8混合写屏障机制的全场景分析