美文网首页
JVM-对象晋升老年代年龄动态调整源码

JVM-对象晋升老年代年龄动态调整源码

作者: 火乐君_52cd | 来源:发表于2020-03-26 20:15 被阅读0次
    uint ageTable::compute_tenuring_threshold(size_t survivor_capacity) {
        //survivor_capacity是survivor空间的大小
      size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100);
      size_t total = 0;
      uint age = 1;
      while (age < table_size) {
        total += sizes[age];//sizes数组是每个年龄段对象大小
        if (total > desired_survivor_size) break;
        age++;
      }
      uint result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold;
        ...
    }
    

    相关文章

      网友评论

          本文标题:JVM-对象晋升老年代年龄动态调整源码

          本文链接:https://www.haomeiwen.com/subject/pcrhuhtx.html