书签 分享 收藏 举报 版权申诉 / 83
上传文档赚钱

类型性能工程师指南:玩转OpenJDK-HotSpot垃圾收集器课件.pptx

  • 上传人(卖家):晟晟文业
  • 文档编号:3903516
  • 上传时间:2022-10-23
  • 格式:PPTX
  • 页数:83
  • 大小:8.84MB
  • 【下载声明】
    1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
    2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
    3. 本页资料《性能工程师指南:玩转OpenJDK-HotSpot垃圾收集器课件.pptx》由用户(晟晟文业)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
    4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
    5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
    配套讲稿:

    如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

    特殊限制:

    部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

    关 键  词:
    性能 工程师 指南 OpenJDK HotSpot 垃圾 收集 课件
    资源描述:

    1、11Performance Engineering2P e r f o r m a n c eE n g i n e e r i n g 2Perfor m a n ce EngineeringPerformance R equirem ents&Test P l a n&DevelopmentPerfor m a n ce Analysis3P e r f o r m a n c e E n g i n e e r i n g P e r f o rRequirementsDesignPerformance R equirem ents&Test P l a n&DevelopmentImp

    2、lementationPerfor m a n ce Analysis4R e q u i r e m e n t s D e s i g n P e r f o r m a n c e Perfor m a n ce R equirem ents5P e r f o r m a n c eR e q u i r e m e n t s 56Performance Requirem entsThro ug hput?R espo n se times?Capacity?Fo otpr int?Availability?6 P e r f o r m a n c e R e q u i r e

    3、m e n t s T h r o7Performance Analysis7 P e r f o r m a n c eA n a l y s i s8Perfor m a n ce AnalysisMon itor ing System Under TestUtil iz atio n,L o c k Stats,Appl icatio n,System,Memory,ProfilingAnaly zin g logs8 P e r f o r m a n c e A n a l y s i s Mo n i t o r i9JVM Performance Engineering9 J V

    4、 MP e r f o r m a n c eE n g i n e e r i n gJava ApplicationJ ava A P IOS+Hardware10JR EJ I T CompilerJava VMG CClass loaderR u ntim eJ a v aA p p l i c a t i o n J a v a A P I O S+Study,Analyz e,TuneJava Devel opm ent KitJ I TC o m piler+RuntimeGarbage Collector/C o l lectio nJ ava API11S t u d y,A

    5、 n a l y z e,T u n e J a v a D eGarbage Collection Perfor m a n ce E ng in eer ing12G a r b a g eC o l l e c t i o n P e r f o r m a n cG CPerfor m a n ce EngineeringJVMMonitoringAppl icatio n ProfilingPro cess&Plot G C logsOnline&Off l in e G C MonitoringHeap Prof il ing13G C J V MA p p l i c a t i

    6、 o n P r o f i l i n g P r oG arbag e C o l lectio n-F acts,Trade-Offs A n d Algorithms14G a r b a g eC o l l e c t i o n-F a c t s,TG C ca n NOT el im in ate yo ur m em o r y leaks!G C(a n d hea p d um p)ca n pro vid e a n insight into your application.15GC Fact!G Cc a nN O Te l i m i n a t ey o u

    7、rm e m oTotal Occupied HeapOld generationYoung generationLive Data Set16T o t a l O c c u p i e d H e a p Y o u n g g e n e rThro ug hput a n d l aten cy are the two m a in drivers towards refinement o f G C algorithms.17GC Fact!T h r o u g h p u ta n dl a t e n c ya r etThe Throughput MaximizerMaxi

    8、mize Thro ug hputG enerationalOldParal lel WorkYo ungC o n c ur rent ThreadsStop-t he-wor l d Threads18T h e T h r o u g h p u t Ma x i m i z e r Ma x i m iMr.Latency SensitiveLatency SensitivePa use o n ly when neededConcurrent Mark i ng/SweepingRe d u ce stop-the-wor l d G Cpause timeNo/Partial C

    9、o m pactio n19Mr.L a t e n c y S e n s i t i v e L a t e n c ySL ets l o okat Open J DK HotSpot G C s:)20L e t sl o o ka tO p e n J D KH o t S p o tThro ug hput MaximizerLatency Sen sitiveParal lel G C21CMS G CG 1 G CT h r o u g h p u t Ma x i m i z e r L a t e n c y Al l G C s in Open J DK HotSpot

    10、are generational.22GC Fact!A l lG C si nO p e n J D KH o t S p o ta r eYo u n g G e n eratio nOld G e n eratio nEd e nSurvivors23Y o u n g G e n e r a t i o n O l d G e n e r a t iEd e nAllocationsSur vivorsYo u n g Generation24E d e n A l l o c a t i o n s S u r v i v o r s Y o u n g25Fast Path All

    11、ocation=L o c k-F r e e Allocation=T hread s Al l o cate I nto T heirLo cal Al l o catio n Buff er(LAB)s2 5 F a s tP a t hA l l o c a t i o n=L o cE d e n26TLABTLABTLABTLABTLABTLAB=Thread Local Allocation BufferE d e n 2 6 T L A B T L A B T L A B T L A B T L A B T L A BThread 1Thread 2Thread 3Thread

    12、 4TLABTLABEd e nTLABTLABTLABThread 027T h r e a d1 T L A B T L A B E d e n T L A B T L A B T hEd e nAllocationsSur vivorsYo u n g GenerationS0S128E d e n A l l o c a t i o n s S u r v i v o r s Y o u n gEd e nAllocationsSur vivorsYo u n g GenerationS0S129E d e n A l l o c a t i o n s S u r v i v o r

    13、 s Y o u n g30G arbag e C o l lectio n-Reclamation.3 0 G a r b a g eC o l l e c t i o n-R e c l a mY o u n g Generation31Old GenerationEd e nS0S1Y o u n gG e n e r a t i o n 3 1 O l dG e n e r a t i*Similar G C Algorithms for Open J DK HotSpotDiff erent G C Al g or ithm s for OpenJDK HotspotAlwa ys

    14、co l lected in its entiretyYo u n g Generation32Old Generation*S i m i l a rG C A l g o r i t h m sf o r OAlwa ys co l lected in its entirety33Yo u n g GenerationOld Generation*Similar G C Algorithms for Open J DK HotSpotDiff erent G C Al g or ithm s for OpenJDK HotspotA l w a y sc o l l e c t e di

    15、ni t se n t i r eY o ung G arbag e C o l lectio n=Reclamation Via Scavenging34Y o u n gG a r b a g eC o l l e c t i o n=ROldGenerationR o ot SetYo u n g Generation35O l dG e n e r a t i o n R o o tS e t Y o u n gG eSurvivorEd e nY o u n g Generation36S u r v i v o r E d e n Y o u n gG e n e r a t i

    16、o n 3 6SurvivorEd e nY o u n g Generation37S u r v i v o r E d e n Y o u n gG e n e r a t i o n 3 7SurvivorEd e nY o u n g Generation38S u r v i v o r E d e n Y o u n gG e n e r a t i o n 3 8Ol d G arbag e C o l lectio n=Different G CAlgorithms39O l dG a r b a g eC o l l e c t i o n=D i fThe Through

    17、put CollectorMulti-ThreadedMulti-Threaded-Entire Heap M a r ke d,Swept a n d Compacted in its entiretyAlwa ys co l lected in its entiretyYo u n g Generation40OldGenerationT h e T h r o u g h p u t C o l l e c t o r Mu l t i-Multi-ThreadedMulti-Threaded-Entire Heap M a r ke d,Swept a n d Compacted in

    18、 its entiretyAlwa ysco l lected in itsentirety41Yo u n g GenerationOld GenerationMu l t i-T h r e a d e d Mu l t i-T h r e a d e d -Old GenerationR o otSetYo u n g GenerationGarbage Collection-Reclamation via Parallel Mark-Compact42O l dG e n e r a t i o n R o o tS e t Y o u n gG eGarbage Collection

    19、-Reclamation via Parallel Mark-CompactOld Generation43G a r b a g e C o l l e c t i o n -R e c l a m a t i oGarbage Collection-Reclamation via Parallel Mark-CompactOld Generation44G a r b a g e C o l l e c t i o n -R e c l a m a t i oGarbage Collection-Reclamation via Parallel Mark-CompactOld Genera

    20、tionso urce reg io n45de stinatio n regionG a r b a g e C o l l e c t i o n -R e c l a m a t i oGarbage Collection-Reclamation via Parallel Mark-CompactOld Generationso urce reg io nde stinatio n region46G a r b a g e C o l l e c t i o n -R e c l a m a t i oGarbage Collection-Reclamation via Paralle

    21、l Mark-Compactde stinatio n regionsource regionsource regionOld Generation47G a r b a g e C o l l e c t i o n -R e c l a m a t i oGarbage Collection-Reclamation via Parallel Mark-Compactde stinatio n regionsource regionsource regionOld Generation48G a r b a g e C o l l e c t i o n -R e c l a m a t i

    22、 oGarbage Collection-Reclamation via Parallel Mark-CompactOld Generation49G a r b a g e C o l l e c t i o n -R e c l a m a t i oThe CMS CollectorMulti-ThreadedMulti-T hreade d-Mostly C o n c ur rent Mark ed a n d Swept in its entiretyAlwa ys co l lected in its entiretyYo u n g GenerationOld Generati

    23、on50T h e C MS C o l l e c t o r Mu l t i-T h r e a d eThe CMS CollectorMulti-ThreadedMulti-T hreade d-Mostly C o n c ur rent Mark ed a n d Swept in its entirety?Always collected in its entiretyYo u n g GenerationOld Generation51T h e C MS C o l l e c t o r Mu l t i-T h r e a d eThe CMS CollectorMul

    24、ti-ThreadedMulti-T hreade d-Mostly C o n c ur rent Mark ed a n d Swept in its entiretyNo Compaction!Always collected in its entiretyYo u n g GenerationOld Generation52T h e C MS C o l l e c t o r Mu l t i-T h r e a d eGarbage Collection-Reclamation via Mark-SweepOld GenerationF ree List53G a r b a g

    25、 e C o l l e c t i o n -R e c l a m a tGarbage Collection-Reclamation via Mark-SweepOld GenerationF ree List54G a r b a g e C o l l e c t i o n -R e c l a m a tA l l non/partial compacting G C s inOpen J DK HotSpot fal lback*to a fu l ly compacting stop-the-world garbage collection called the“full”G

    26、 C.55*Tun ing ca n hel p avo id o r po stpo n e f ul l G C s in m a n y cases.GC Fact!A l ln o n/p a r t i a lc o m p a c t i n gG C sSingle Threaded-Entire Heap M a r ke d,Swept a n d Compacted in its entiretyYo u n g GenerationOld Generation56Garbage Collection-Reclamation via Mark-Sweep-CompactS

    27、i n g l e T h r e a d e d -E n t i r e H e a pSingle Threaded-Entire Heap M a r ke d,Swept a n d Compacted in its entiretyYo u n g GenerationOld Generation57Garbage Collection-Reclamation via Mark-Sweep-CompactS i n g l e T h r e a d e d -E n t i r e H e a pWhat Abo ut G arbag e F irst G C?58Wh a tA

    28、 b o u tG a r b a g eF i r s tG C?5 8Heap RegionsC o ntig uo us J ava Hea pFree Reg io nNon-F ree Region59H e a p R e g i o n s C o n t i g u o u sJ a v aH eThe Garbage First Collector-Regionalized HeapEd e n60OldOldEd e nOldSur vivorHumongousT h e G a r b a g e F i r s t C o l l e c t o r E d eThe

    29、Garbage First CollectorEd e n2016 CodeKaram61OldOldEd e nOldSur v ivo rE.g.:C u r rent hea p co n f ig uratio n-T h e G a r b a g e F i r s t C o l l e c t o r E d eThe Garbage First CollectorEd e n2016CodeKaram62OldOldEd e nOldSur v ivo rE.g.:Dur inga yo ung co l lectio n-T h e G a r b a g e F i r

    30、s t C o l l e c t o r E d eThe Garbage First CollectorOld2016 CodeKaram63OldOldE.g.:After a yo ungco l lectio n-Sur viv orOl dT h e G a r b a g e F i r s t C o l l e c t o r O l dThe Garbage First CollectorOld2016 CodeKaram64OldOldE.g.:C u r renthea pco n f ig uratio n-Sur viv orOl dEd e nEd e nOldT

    31、 h e G a r b a g e F i r s t C o l l e c t o r O l dOld2016 CodeKaram65OldOldSur viv orE.g.:Rec l am atio n o f a g arbag e-f il led reg io n d u r i n g thecleanup phase-Ol dEd e nEd e nOldThe Garbage First CollectorO l d 2 0 1 6C o d e K a r a m 6 5 O l d O l d S u r Old2016 CodeKaram66OldOldSur v

    32、iv orE.g.:Rec l am atio n o fag arbag e-f il led reg io n d u r i n g the cleanup phase-Ol dEd e nEd e nThe Garbage First CollectorO l d 2 0 1 6C o d e K a r a m 6 6 O l d O l d S u r Old2016 CodeKaram67OldOldE.g.:C u r rent hea p co n f ig uratio n-Sur viv orOl dEd e nEd e nThe Garbage First Collec

    33、torO l d 2 0 1 6C o d e K a r a m 6 7 O l d O l d E.g.Old2016 CodeKaram68OldOldE.g.:Dur ing a m ix ed co l lectio n-Sur viv orOl dEd e nEd e nThe Garbage First CollectorO l d 2 0 1 6C o d e K a r a m 6 8 O l d O l d E.g.Old2016 CodeKaram69E.g.:After a m ix edco l lectio n-Ol dSur vivo rOldThe Garbag

    34、e First CollectorO l d 2 0 1 6C o d e K a r a m 6 9 E.g.:A f t eThe Garbage First Collector-Pause HistogramPause time in milliseconds030609012034153416.33417.23418.4341934223423.43432.23433.23436.83437.63438.93440TimestampsYoung CollectionInitial MarkRemark70CleanupMixed CollectionInitiating Heap Oc

    35、cupancy PercentT h e G a r b a g e F i r s t C o l l e c t o r P a uF in al ly,L etsTal k Abo ut Tuning!:)71F i n a l l y,L e t sT a l kA b o u t T u nTun ing G CF or T hro ug hput Or For Latency?72T u n i n gG CF o rT h r o u g h p u tO r FG C E l a psed T im e Or G C Overhead73G CE l a p s e dT i

    36、m eO rG C O v e r h e aGC Elapsed Timeindicated the amount of time ittakes to executestop the world GC events2016 CodeKaram74T he hig her the G C el a psed tim e-the l o wer the application responsiveness due to the G C induced latenciesG C E l a p s e d T i m e i n d i c a t e d t h e a mOverhead i

    37、s an indication of the frequency ofstop the world GC events.2016 CodeKaram75T he m ore f requent the G C events-T he m ore likely it is to negatively impact applicationthroughputO v e r h e a d i s a n i n d i c a t i o n o f t h e f rWhats T he#1 C o ntr ibutor To A G CElapsed Time?76Wh a t sT h e#

    38、1C o n t r i b u t o rT oC o pying C o sts!77C o p y i n gC o s t s!7 7What Are T he C o ntr ibutorS To G COverhead?78Wh a tA r eT h eC o n t r i b u t o r ST o Al l o catio n R ate a n d Promotion Rate79A l l o c a t i o nR a t ea n d P r o m o t i o n80Size generations keeping your applications ob

    39、ject longevity and size in mind.The faster the generation gets“filled”;the sooner a GC is triggered.Size your generations and age your objects appropriately.The higher the amount of live data to be copied,the longer the GC pause.Premature promotions are a big problem!Tuning Recommendations 8 0 S i z

    40、 e g e n e r a t i o n s k e e p i n g y oPlot Allocation&Promotion Rates81P l o t A l l o c a t i o n&P r o m o t i o n RYoung Occupancy before GCYoung Gen SizeOld Gen Occupancy after GC82Heap Occupancy before GCHeap Occupancy after GCHeap SizeTimestampsY o u n g O c c u p a n c y b e f o r e G C Y o u n gQuestions?83Q u e s t i o n s?8 3

    展开阅读全文
    提示  163文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
    关于本文
    本文标题:性能工程师指南:玩转OpenJDK-HotSpot垃圾收集器课件.pptx
    链接地址:https://www.163wenku.com/p-3903516.html

    Copyright@ 2017-2037 Www.163WenKu.Com  网站版权所有  |  资源地图   
    IPC备案号:蜀ICP备2021032737号  | 川公网安备 51099002000191号


    侵权投诉QQ:3464097650  资料上传QQ:3464097650
       


    【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。

    163文库