当前位置:网站首页>What is the process of ⼀ objects from loading into JVM to being cleared by GC?

What is the process of ⼀ objects from loading into JVM to being cleared by GC?

2022-07-07 14:50:00 51CTO

⼀ Objects loaded from to JVM, And then to be GC eliminate , What process has it gone through ?_ Old age

  • Object application space
  • Judge Eden Whether the area has allocable object space , If Eden Area assignable , Allocate space directly
  • If space is insufficient, proceed YGC, in the light of YGC Objects that survive ,YGC The operation details are as follows :
    • Judge Survivor Whether the area can allocate space , Distributable , From from To to District (S0/S1 Switch back and forth ), threshold + 1
    • Survivor Zone is not assignable , Then directly promoted to the elderly generation
    • Judge Survivor Whether the threshold of the zone object is greater than 15, If it is larger than, it will be promoted to the elderly , Otherwise, from from To to District , threshold + 1
  • YGC Then judge Eden Whether the area has allocable object space , If yes, allocate space directly , Otherwise, judge whether the elderly area can allocate space
  • Elderly areas can be allocated , Then the application object space , If not, proceed FGC
  • Then judge whether the elderly area can be allocated , Distributable , Then the application object space , If it cannot be allocated, an error will be reported OOM(Out Of Memory)
原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071233108075.html