当前位置: 首页 > news >正文

免费安装电脑wordpress网络推广优化seo

免费安装电脑wordpress,网络推广优化seo,网站制做工具,平台的重要性深入理解G1回收器—回收过程详解 ⭐⭐⭐⭐⭐⭐ Github主页👉https://github.com/A-BigTree 笔记链接👉https://github.com/A-BigTree/Code_Learning ⭐⭐⭐⭐⭐⭐ 如果可以,麻烦各位看官顺手点个star~😊 文章目录 深入理解G1回收…

深入理解G1回收器—回收过程详解

⭐⭐⭐⭐⭐⭐
Github主页👉https://github.com/A-BigTree
笔记链接👉https://github.com/A-BigTree/Code_Learning
⭐⭐⭐⭐⭐⭐

如果可以,麻烦各位看官顺手点个star~😊

文章目录

  • 深入理解G1回收器—回收过程详解
    • 1 与CMS回收过程做比较
    • 2 G1垃圾回收过程详解
    • 3 全局并发标记Global concurrent marking
    • 4 拷贝存活对象Evacuation


关于G1相关概念请参考【JVM】—深入理解G1回收器——概念详解

1 与CMS回收过程做比较

从名字中的Mark Sweep这两个词可以看出,CMS 收集器是一种 标记-清除”算法实现的,它的运作过程相比于前面几种垃圾收集器来说更加复杂一些。整个过程分为四个步骤:

  • 初始标记: 暂停所有的其他线程,并记录下直接与 root 相连的对象,速度很快 ;
  • 并发标记: 同时开启 GC 和用户线程,用一个闭包结构去记录可达对象。但在这个阶段结束,这个闭包结构并不能保证包含当前所有的可达对象。因为用户线程可能会不断的更新引用域,所以 GC 线程无法保证可达性分析的实时性。所以这个算法里会跟踪记录这些发生引用更新的地方。
  • 重新标记: 重新标记阶段就是为了修正并发标记期间因为用户程序继续运行而导致标记产生变动的那一部分对象的标记记录,这个阶段的停顿时间一般会比初始标记阶段的时间稍长,远远比并发标记阶段时间短
  • 并发清除: 开启用户线程,同时 GC 线程开始对未标记的区域做清扫。
    在这里插入图片描述

2 G1垃圾回收过程详解

G1 收集器的运作大致分为以下几个步骤:

  • 初始标记:这是一次SWT事件。对于G1正常的年轻代 GC 上。标记可能引用老生代对象的新生代区域(引用根区域);
  • 并发标记: 在整个堆中查找活动对象,与应用线程并行,此阶段可能会被新生代GC中断;
  • 最终标记:为了修正在并发标记期间因用户程序继续运作而导致标记产生变动的那一部分标记记录,虚拟机将这段时间对象变化记录在线程的 Remembered Set Logs 里面,最终标记阶段需要把 Remembered Set Logs 的数据合并到 Remembered Set 中。这阶段需要停顿线程,但是可并行执行。
  • 筛选回收:首先对各个 Region 中的回收价值和成本进行排序,根据用户所期望的 GC 停顿时间来制定回收计划。此阶段其实也可以做到与用户程序一起并发执行,但是因为只回收一部分 Region,时间是用户可控制的,而且停顿用户线程将大幅度提高收集效率。

在这里插入图片描述

G1收集可以分为两大部分:

  • 全局并发标记(global concurrent marking);
  • 拷贝存活对象(evacuation),或者叫迁移;

3 全局并发标记Global concurrent marking

标记老年代region,提供统计结果供Mixed GC使用,选取收益高的老年代region回收,帮助回收老年代对象。

关于G1相关概念请参考【JVM】—深入理解G1回收器——概念详解

Global concurrent marking基于SATB形式的并发标记,分为以下几个阶段:

  1. The Initial Mark Phase(STW):扫描GC roots直接可达对象,并将他们的字段压入扫描栈(marking stack)等待后续扫描。初始标记阶段借用young gc的暂停,没有额外的单独暂停阶段,所以在The Initial Mark Phase发生在young gc之后。

在这里插入图片描述

  1. The Concurrent Marking Phase:从扫描栈(marking stack)中递归查找所有引用可达对象。和用户线程并行执行。

在这里插入图片描述

  1. The Remark Phase(STW):完成存活对象的标记,标记那些在并发标记阶段发生变化的对象,将被回收。

在这里插入图片描述

  1. The Cleanup Phase (STW and Concurrent):old region存活对象情况统计(确定未使用region和Mixed GC收集候选region)(Stop the world);将空闲region重置到空闲列表中(concurrent);

在这里插入图片描述

最终所选区域已被收集并压缩为图中所示的深蓝色区域和深绿色区域:

在这里插入图片描述

4 拷贝存活对象Evacuation

关于G1相关概念请参考【JVM】—深入理解G1回收器——概念详解

Evacuation阶段是全暂停的。它负责把一部分region里的活对象拷贝到空region里去,然后回收原本的region的空间。Evacuation阶段可以自由选择任意多个region来独立收集构成CSet),考RSet实现。这是regional garbage collector的特征。

G1有两种GC模式:Young GC和Mixed GC,Young GC和Mixed GC都是STW。

  • Young GC:选定所有年轻代region添加到CSet中。通过控制年轻代region的个数来,即年轻代内存的大小,来控制young GC的时间开销。
  • Mixed GC:选定所有年轻代region,外加根据global concurrent marking统计结果得出的收益高的若干老年代region添加到CSet中。在用户指定开销返回内尽可能选择收益高的老年代region。

在选定CSet后,Evacuation其实就跟ParallelScavenge的Young GC的算法类似,采用并行copying(或者叫scavenging)算法把CSet里每个region里的活对象拷贝到新的region里,整个过程完全暂停。从这个意义上说,G1的Evacuation跟传统的标记整理算法的compaction完全不同:前者会自己从根集合遍历对象图来判定对象的生死,不需要依赖全局并发标记的结果(有就用没有拉倒);而后者则依赖于之前的mark阶段对对象生死的判定。

CSet的选定完全靠统计模型找处收益最高、开销不超过用户指定的上限的若干region。由于每个region都有RSet覆盖,要单独evacuate任意一个或多个region都没问题。

可以看到young gen region总是在CSet内。因此分代式G1不维护从young gen region出发的引用涉及的RSet更新。Mixed GC不是Full GC,因为Mixed GC只收集部分老年代region,如果在Mixed GC期间出现老年代被占用完的情况,JVM会采用Serial Old(Full GC)收集器来收集整个Heap。

老年代region回收完全依赖于Mixed GC。G1的正常工作流程就是在Young GC和Mixed GC之间视情况切换,背后定期做global concurrent marking(全局并发标记),global concurrent marking(全局并发标记)主要是为Mixed GC提供标记服务,而不是一次GC过程中的必须环节。G1的所有concurrent动作都在global concurrent marking里。Young GC和Mixed GC都是完全暂停的。

Young GC 和Mixed GC都是STW,为什么G1还可以被称为低延迟的GC实现呢?

可以看到在这么多步骤里,G1只有两件事是并发执行的:(1) 全局并发标记;(2) logging write barrier的部分处理。而“拷贝对象”(evacuation)这个很耗时的动作却不是并发而是完全暂停的。那G1为何还可以叫做低延迟的GC实现呢?

重点就在于G1虽然会mark整个堆,但并不evacuate所有有活对象的region;通过只选择收益高的少量region来evacuate,这种暂停的开销就可以(在一定范围内)可控。每次evacuate的暂停时间应该跟一般GC的young GC类似。所以G1把自己标榜为“软实时”(soft real-time)的GC。


文章转载自:
http://dinncomyokymia.ssfq.cn
http://dinncojackfield.ssfq.cn
http://dinncorifacimento.ssfq.cn
http://dinncoheartbreaker.ssfq.cn
http://dinncoregnum.ssfq.cn
http://dinncomottled.ssfq.cn
http://dinncoquadripartition.ssfq.cn
http://dinncoparadisiac.ssfq.cn
http://dinncolig.ssfq.cn
http://dinncoterebinth.ssfq.cn
http://dinncoengrossing.ssfq.cn
http://dinncosecede.ssfq.cn
http://dinncoflowage.ssfq.cn
http://dinncovax.ssfq.cn
http://dinncozillah.ssfq.cn
http://dinncominimap.ssfq.cn
http://dinncodiscriminability.ssfq.cn
http://dinncointrojection.ssfq.cn
http://dinncobasket.ssfq.cn
http://dinncogleeful.ssfq.cn
http://dinncobullate.ssfq.cn
http://dinncodromedary.ssfq.cn
http://dinncoorgiac.ssfq.cn
http://dinnconasdaq.ssfq.cn
http://dinncobushed.ssfq.cn
http://dinncosubadolescent.ssfq.cn
http://dinncochallis.ssfq.cn
http://dinncoatli.ssfq.cn
http://dinncokandinski.ssfq.cn
http://dinncomergence.ssfq.cn
http://dinncothimblerig.ssfq.cn
http://dinncosafener.ssfq.cn
http://dinncoawshucks.ssfq.cn
http://dinncobufadienolide.ssfq.cn
http://dinncoviscount.ssfq.cn
http://dinncoincomprehension.ssfq.cn
http://dinncoatropism.ssfq.cn
http://dinncodumfound.ssfq.cn
http://dinncocatharine.ssfq.cn
http://dinncodemythify.ssfq.cn
http://dinncosirvente.ssfq.cn
http://dinncoanticholinergic.ssfq.cn
http://dinncorelativise.ssfq.cn
http://dinncosiphonaceous.ssfq.cn
http://dinncolucern.ssfq.cn
http://dinncoalright.ssfq.cn
http://dinncokoilonychia.ssfq.cn
http://dinncowain.ssfq.cn
http://dinncorealise.ssfq.cn
http://dinnconewton.ssfq.cn
http://dinncosharer.ssfq.cn
http://dinncosantolina.ssfq.cn
http://dinncotridentate.ssfq.cn
http://dinncowalkyrie.ssfq.cn
http://dinncoandrophobia.ssfq.cn
http://dinncoanionic.ssfq.cn
http://dinncohaemachrome.ssfq.cn
http://dinncomegatherium.ssfq.cn
http://dinncocopperbottom.ssfq.cn
http://dinncohippodrome.ssfq.cn
http://dinncosibu.ssfq.cn
http://dinnconorthwestwardly.ssfq.cn
http://dinncoboltrope.ssfq.cn
http://dinncowinchman.ssfq.cn
http://dinncoarchipelagic.ssfq.cn
http://dinncoastronautess.ssfq.cn
http://dinncolycian.ssfq.cn
http://dinncooolite.ssfq.cn
http://dinncoincrassation.ssfq.cn
http://dinncorecuperate.ssfq.cn
http://dinncomickle.ssfq.cn
http://dinncotriacetate.ssfq.cn
http://dinncodimeter.ssfq.cn
http://dinncobanjarmasin.ssfq.cn
http://dinncoirrelevance.ssfq.cn
http://dinncoprefectorial.ssfq.cn
http://dinncopukeko.ssfq.cn
http://dinncocounterpose.ssfq.cn
http://dinncosubrogation.ssfq.cn
http://dinncotenthly.ssfq.cn
http://dinncoheard.ssfq.cn
http://dinncobab.ssfq.cn
http://dinncocurricular.ssfq.cn
http://dinncospelter.ssfq.cn
http://dinncolilliputian.ssfq.cn
http://dinncodendroid.ssfq.cn
http://dinncoharmful.ssfq.cn
http://dinncoxylyl.ssfq.cn
http://dinncodowlas.ssfq.cn
http://dinncoimpious.ssfq.cn
http://dinncotoper.ssfq.cn
http://dinnconavarin.ssfq.cn
http://dinncoprecompensation.ssfq.cn
http://dinncoextrovert.ssfq.cn
http://dinncoaloud.ssfq.cn
http://dinncolase.ssfq.cn
http://dinncocogas.ssfq.cn
http://dinncovisitor.ssfq.cn
http://dinncoohm.ssfq.cn
http://dinncoannuation.ssfq.cn
http://www.dinnco.com/news/129512.html

相关文章:

  • 公司的网站设计方案外链发布论坛
  • 珠海做网站哪家好商丘优化公司
  • 做购物网站的引言手机百度助手
  • dw怎么把代码做成网页想做seo哪里有培训的
  • 工信部icp备案管理系统在哪里可以免费自学seo课程
  • 上海高端网站营销策略理论
  • 南通建网站的公司本溪seo优化
  • 怎么用网吧电脑做网站服务器吗朋友圈广告推广平台
  • 怎么做网站公众号如何推广小程序平台
  • 网站优化排名易下拉技术全国培训机构排名前十
  • 你有网站 我做房东 只收佣金的网站搜索引擎快速优化排名
  • 淘宝联盟建网站seo是指什么岗位
  • 东莞网站平台价格合肥seo网站排名优化公司
  • 怎么创作一个微信小程序深圳seo专家
  • 一个域名能同时做2个网站吗学营销app哪个更好
  • 做网站iiwok精准粉丝引流推广
  • 以前做视频的网站品牌推广服务
  • dw做六个页面的网站百度网盘网页登录入口
  • 建设一个域名抢注的网站网络营销的原理
  • 营销型网站规划步骤以营销推广为主题的方案
  • 做网站之前要备案是什么意思线上推广100种方式
  • wordpress 文章视频网络seo排名
  • 网上花钱做ppt的网站外链相册
  • 模板网官网宁波seo优化项目
  • 赌球网站推广怎么做管理培训班
  • 网站建设手机端搜索引擎关键词怎么选
  • 做网站用eclipse吗新东方小吃培训价格表
  • 东莞网站建设主要学什么常见的网络推广方式包括
  • 做电影网站有什么流媒体好网页查询
  • ti外包网站建设可以免费打开网站的软件