introduction-to-modern-gc

 introduction-to-modern-gc

Shenandoah GC・ZGC・Epsilon GCをざっくり理解したい!

JJUG CCC 2018 Spring での発表資料です

49b08973c143dc1424a05364e518d361?s=128

tomoya yokota

May 26, 2018
Tweet

Transcript

  1. 4.

    GCͱΞϓϦఀࢭ(STW) Compaction GC Parallel GC young gc old gc GC

    = ΞϓϦέʔγϣϯεϨουఀࢭ ϝϞϦ͕ϑϥάϝϯτ͠ͳ͍ CPUෛՙ͸খ͍͞ Stop The world = ΞϓϦέʔγϣϯεϨουͷఀࢭ Mark Compaction GC Noop
  2. 5.

    GCͱΞϓϦఀࢭ(STW) CMS GC Compaction GC young gc marking sweep GC

    old gc initial-mark final-remark young gc͸ΞϓϦέʔγϣϯεϨουఀࢭ major gc͸΄΅ฒྻ ϝϞϦͷϑϥάϝϯτ͕ܽ఺ Stop The world = ΞϓϦέʔγϣϯεϨουͷఀࢭ Concurrent = ΞϓϦέʔγϣϯεϨουͱฒྻ
  3. 6.

    GCͱΞϓϦఀࢭ(STW) G1GC Compaction GC young gc Marking old gc initial-mark

    final-remark young gc͸ΞϓϦέʔγϣϯεϨουఀࢭ major gc͸໨ඪఀࢭ࣌ؒΛݩʹGCΛߦ͏ ϝϞϦ͕ϑϥάϝϯτ͠ͳ͍ Stop The world = ΞϓϦέʔγϣϯεϨουͷఀࢭ Compaction GC Concurrent = ΞϓϦέʔγϣϯεϨουͱฒྻ
  4. 7.

    GCͱΞϓϦఀࢭ(STW) Parallel GC CMS GC G1GC young gc Concurrent mark

    Concurrent sweep Mark Concurrent mark old gc Compaction GC Compaction GC Compaction GC Compaction GC Compaction GC Noop
  5. 14.

    ฒྻίϯύΫγϣϯͷ໰୊఺ Pointer x = 1 y = 2 z= 3

    Pointer x = 1 y= 2 z= 3 GCεϨου͕Ҡಈத • GCεϨου͕ΦϒδΣΫτͷҠಈதʹ
 ϦϑΝϨϯεͷॻ͖׵͕͑ى͖ΔՄೳੑ Ͳ͕ͬͪຊ෺ʁ
  6. 16.

    Brooks pointer Pointer Header x = 1 y = 2

    z= 3 Pointer Header x = 1 y= 2 z= 3 ࢀরઌ͕ίϯύΫγϣϯ͞Εͨݹ͍ΦϒδΣΫτͳΒ ϔομʔΛͨͲͬͯɺ৽͍͠ΦϒδΣΫτΛࢀর͢Δ
  7. 25.

    GCશମΛͳ͕ΊͯΈΔ Initial Mark Final Remark Concurrent Mark Concurrent Compaction update

    Reference Concurrent update Reference final update Reference Application work Application work Application work ฒྻίϯύΫγϣϯͷ͓͔͛Ͱ
 ίϯύΫγϣϯ࣌ͷSTWΛͳͭͭ͘͠
 ϑϥάϝϯτΛ๷͙͜ͱ͕Ͱ͖ΔΑ͏ʹͳͬͨ Stop the world
  8. 26.

    ZGC

  9. 31.

    ΦϒδΣΫτͷΞυϨεදݱ 42 bit ࠷େ4TBͷΞυϨεΛදݱͰ͖Δ 4 1 17 bit ະ࢖༻ ΧϥʔϙΠϯλΛදݱ

    1. 64bitͷΞυϨεۭؒશ෦࢖͏ 2. ώʔϓΞυϨε͸ԼҐ42bitΛར༻ 3. 4bitͰΧϥʔϙΠϯλͷ৭Λදݱ
  10. 32.

    64bitΞυϨεΛ࠷େݶར༻ Heap(4TB) marked0 marked1 remapped 0x0000040000000000 0x0000000000000000 0x0000080000000000 0x00000C0000000000 0x0000100000000000

    0x0000140000000000 0x000010001234abcdef 1. ΦϒδΣΫτ͸଴ආࡁΈ 2. 001234abcdefʹ࣮ମ ZGCͰ͸64bitͷΞυϨεΛ࢖͏.ϝϞϦ͕128TBඞཁ
  11. 43.

    GCશମΛͳ͕ΊͯΈΔ ark Final Remark oncurrent Mark Concurrent Compaction pplication work

    Application work Initial Mark Final Remark Concurrent Mark/Remap Concurrent Compaction Application work Application work GC1प໨ GC2प໨
  12. 49.