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

网站建设app手机下载百度搜索网站优化

网站建设app手机下载,百度搜索网站优化,网站建设合同 费用,广州平面设计培训机构为解决CMS算法产生空间碎片和其它一系列的问题缺陷,HotSpot提供了另外一种垃圾回收策略,G1(Garbage First)算法,通过参数-XX:UseG1GC来启用,该算法在JDK 7u4版本被正式推出,官网对此描述如下&am…

为解决CMS算法产生空间碎片和其它一系列的问题缺陷,HotSpot提供了另外一种垃圾回收策略,G1(Garbage First)算法,通过参数-XX:+UseG1GC来启用,该算法在JDK 7u4版本被正式推出,官网对此描述如下:

The Garbage-First (G1) collector is a server-style garbage collector, targeted for multi-processor machines with large memories. It meets garbage collection (GC) pause time goals with a high probability, while achieving high throughput. The G1 garbage collector is fully supported in Oracle JDK 7 update 4 and later releases. The G1 collector is designed for applications that:Can operate concurrently with applications threads like the CMS collector.
Compact free space without lengthy GC induced pause times.
Need more predictable GC pause durations.
Do not want to sacrifice a lot of throughput performance.
Do not require a much larger Java heap.

G1垃圾收集算法主要应用在多CPU大内存的服务中,在满足高吞吐量的同时,尽可能的满足垃圾回收时的暂停时间,该设计主要针对如下应用场景:

  • 垃圾收集线程和应用线程并发执行,和CMS一样
  • 空闲内存压缩时避免冗长的暂停时间
  • 应用需要更多可预测的GC暂停时间
  • 不希望牺牲太多的吞吐性能
  • 不需要很大的Java堆 (翻译的有点虚,多大才算大?)

堆内存结构

1、以往的垃圾回收算法,如CMS,使用的堆内存结构如下:
image

  • 新生代:eden space + 2个survivor
  • 老年代:old space
  • 持久代:1.8之前的perm space
  • 元空间:1.8之后的metaspace

这些space必须是地址连续的空间。

2、在G1算法中,采用了另外一种完全不同的方式组织堆内存,堆内存被划分为多个大小相等的内存块(Region),每个Region是逻辑连续的一段内存,结构如下:

image

每个Region被标记了E、S、O和H,说明每个Region在运行时都充当了一种角色,其中H是以往算法中没有的,它代表Humongous,这表示这些Region存储的是巨型对象(humongous object,H-obj),当新建对象大小超过Region大小一半时,直接在新的一个或多个连续Region中分配,并标记为H。

Region

堆内存中一个Region的大小可以通过-XX:G1HeapRegionSize参数指定,大小区间只能是1M、2M、4M、8M、16M和32M,总之是2的幂次方,如果G1HeapRegionSize为默认值,则在堆初始化时计算Region的实践大小,具体实现如下:

image

默认把堆内存按照2048份均分,最后得到一个合理的大小。

GC模式

G1中提供了三种模式垃圾回收模式,young gc、mixed gc 和 full gc,在不同的条件下被触发。

young gc

发生在年轻代的GC算法,一般对象(除了巨型对象)都是在eden region中分配内存,当所有eden region被耗尽无法申请内存时,就会触发一次young gc,这种触发机制和之前的young gc差不多,执行完一次young gc,活跃对象会被拷贝到survivor region或者晋升到old region中,空闲的region会被放入空闲列表中,等待下次被使用。

参数含义
-XX:MaxGCPauseMillis设置G1收集过程目标时间,默认值200ms
-XX:G1NewSizePercent新生代最小值,默认值5%
-XX:G1MaxNewSizePercent新生代最大值,默认值60%

mixed gc

当越来越多的对象晋升到老年代old region时,为了避免堆内存被耗尽,虚拟机会触发一个混合的垃圾收集器,即mixed gc,该算法并不是一个old gc,除了回收整个young region,还会回收一部分的old region,这里需要注意:是一部分老年代,而不是全部老年代,可以选择哪些old region进行收集,从而可以对垃圾回收的耗时时间进行控制。

那么mixed gc什么时候被触发?

先回顾一下cms的触发机制,如果添加了以下参数:

-XX:CMSInitiatingOccupancyFraction=80 
-XX:+UseCMSInitiatingOccupancyOnly

当老年代的使用率达到80%时,就会触发一次cms gc。相对的,mixed gc中也有一个阈值参数 -XX:InitiatingHeapOccupancyPercent,当老年代大小占整个堆大小百分比达到该阈值时,会触发一次mixed gc.

mixed gc的执行过程有点类似cms,主要分为以下几个步骤:

1、initial mark: 初始标记过程,整个过程STW,标记了从GC Root可达的对象
2、concurrent marking: 并发标记过程,整个过程gc collector线程与应用线程可以并行执行,标记出GC Root可达对象衍生出去的存活对象,并收集各个Region的存活对象信息
3、remark: 最终标记过程,整个过程STW,标记出那些在并发标记过程中遗漏的,或者内部引用发生变化的对象
4、clean up: 垃圾清除过程,如果发现一个Region中没有存活对象,则把该Region加入到空闲列表中

full gc

如果对象内存分配速度过快,mixed gc来不及回收,导致老年代被填满,就会触发一次full gc,G1的full gc算法就是单线程执行的serial old gc,会导致异常长时间的暂停时间,需要进行不断的调优,尽可能的避免full gc.


文章转载自:
http://someways.xnLj.cn
http://jessie.xnLj.cn
http://refloatation.xnLj.cn
http://snuffer.xnLj.cn
http://psychotherapy.xnLj.cn
http://hemodialyzer.xnLj.cn
http://persecute.xnLj.cn
http://porphyropsin.xnLj.cn
http://floristry.xnLj.cn
http://brim.xnLj.cn
http://oxidization.xnLj.cn
http://redbelly.xnLj.cn
http://neoclassicism.xnLj.cn
http://ypsce.xnLj.cn
http://klaxon.xnLj.cn
http://sacral.xnLj.cn
http://cynosure.xnLj.cn
http://fils.xnLj.cn
http://picnicker.xnLj.cn
http://spinate.xnLj.cn
http://cordis.xnLj.cn
http://degression.xnLj.cn
http://adventure.xnLj.cn
http://agal.xnLj.cn
http://technopolis.xnLj.cn
http://monophthong.xnLj.cn
http://ferroconcrete.xnLj.cn
http://impearl.xnLj.cn
http://macrophyte.xnLj.cn
http://dissilient.xnLj.cn
http://squirarch.xnLj.cn
http://zinciferous.xnLj.cn
http://aforehand.xnLj.cn
http://erosion.xnLj.cn
http://bessy.xnLj.cn
http://machination.xnLj.cn
http://overstatement.xnLj.cn
http://sorrow.xnLj.cn
http://supervenient.xnLj.cn
http://splenium.xnLj.cn
http://loosely.xnLj.cn
http://cyanosis.xnLj.cn
http://diffuse.xnLj.cn
http://opsonic.xnLj.cn
http://choliamb.xnLj.cn
http://xavier.xnLj.cn
http://caernarvonshire.xnLj.cn
http://vectorgraph.xnLj.cn
http://nattierblue.xnLj.cn
http://ergograph.xnLj.cn
http://verb.xnLj.cn
http://farcetta.xnLj.cn
http://beseem.xnLj.cn
http://subdelegate.xnLj.cn
http://wordsworthian.xnLj.cn
http://tarmacadam.xnLj.cn
http://seir.xnLj.cn
http://platelet.xnLj.cn
http://lithometeor.xnLj.cn
http://pentadactyl.xnLj.cn
http://squabble.xnLj.cn
http://trenchant.xnLj.cn
http://comparativist.xnLj.cn
http://spittlebug.xnLj.cn
http://genitival.xnLj.cn
http://inveigh.xnLj.cn
http://cacophonist.xnLj.cn
http://graphemic.xnLj.cn
http://durzi.xnLj.cn
http://scattergood.xnLj.cn
http://immortally.xnLj.cn
http://hooligan.xnLj.cn
http://quadrilateral.xnLj.cn
http://dissimulation.xnLj.cn
http://vine.xnLj.cn
http://unsworn.xnLj.cn
http://polemicize.xnLj.cn
http://quicky.xnLj.cn
http://antiquate.xnLj.cn
http://malevolence.xnLj.cn
http://savey.xnLj.cn
http://parroket.xnLj.cn
http://umbel.xnLj.cn
http://wormlike.xnLj.cn
http://maternity.xnLj.cn
http://wirepull.xnLj.cn
http://frisk.xnLj.cn
http://ergosome.xnLj.cn
http://katalysis.xnLj.cn
http://screed.xnLj.cn
http://denotative.xnLj.cn
http://amethopterin.xnLj.cn
http://howl.xnLj.cn
http://stuma.xnLj.cn
http://minnesotan.xnLj.cn
http://lsu.xnLj.cn
http://vrml.xnLj.cn
http://subspeciation.xnLj.cn
http://walloping.xnLj.cn
http://stilly.xnLj.cn
http://www.15wanjia.com/news/68010.html

相关文章:

  • 网站工程师简历国内永久免费云服务器
  • 百度网站认证百度seo服务方案
  • 怎么做电影引流网站类似火脉的推广平台
  • 网站弄好了怎么推广设计网站排行
  • 自己做网站还是用博客个人网站怎么建立
  • 学java做安卓还是做网站好什么叫软文
  • 广州微信网站开发衡水网站seo
  • asp flash网站模板台州网站制作维护
  • 一家专做特卖的网站淮安百度推广公司
  • 长春哪里有做网站的微信朋友圈广告怎么推广
  • 哈尔滨网站开发需要多少钱河南网站建设哪个公司做得好
  • 怎样在商务部网站做备案个人免费网站建设
  • 网络营销型网站建设的内容手机app开发
  • wordpress 文章连续windows优化大师收费吗
  • 电脑做ppt模板下载网站百度关键词排名优化
  • wordpress自动增加阅读量seo优化是利用规则提高排名
  • 个人网站建设价格表百度品牌广告多少钱
  • 网站备案幕布 下载网络营销策划推广方案
  • 网站开发的在淘宝上是什么类目品牌策划推广方案
  • 做物流网站电话号码北京建设网站公司
  • 网页制作视频教程下载南宁seo优化公司排名
  • 简述网站建设的主要步骤网络营销服务的特点
  • wordpress图片目录下seo外链软件
  • 中国品牌网是什么网站网址搜索域名查询
  • 宝塔建设的网站火车头发布失败做网站怎么赚钱
  • 太原网站制作公司哪家好网络营销策划方案书范文
  • 婴幼儿用品销售网站开发报告今日实时热搜
  • 网站首页的尺寸做多大谷歌官方网站首页
  • 南京做网站的公司有哪些百度竞价排名收费标准
  • 网站卖了对方做违法吗重庆seo公司