为什么大多数JVM gcs不使用refcounts?

编程入门 行业动态 更新时间:2024-10-17 17:18:09
本文介绍了为什么大多数JVM gcs不使用refcounts?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为什么他们不需要它们,如果有人决定实现一个使用它们的虚拟机,他们可能会面临哪些问题? 解决方案

>

  • 计数引用必须在对象之外完成。
  • 计数引用很慢。处理w /循环引用的速度更慢,但这并非不可能。仍然很慢。
  • 计数引用实际上很慢,因为它必须使用CAS +循环
  • 不计数引用更容易实现,速度更快,与一些操作系统内存页面技巧。
  • 只要对象没有转义,引用计数可以通过转义分析完全删除。

    Why don't they need them, and if someone decided to implement a VM that used them, what problems might they face?

    解决方案

  • Counting references must be done outside the object.
  • Counting references is slow. Even slower to deal w/ cyclic references but that's not impossible. Still slow.
  • Counting references is actually very slow since it must use CAS + loop
  • Not-Counting references is easier to implement and it's faster, esp. with some OS memory page tricks.
  • Reference counting can be removed altogether by escape analysis, provided the object doesn't escape.

  • 更多推荐

    为什么大多数JVM gcs不使用refcounts?

    本文发布于:2023-11-10 02:49:16,感谢您对本站的认可!
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:JVM   gcs   refcounts

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!