Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8337815

Relax G1EvacStats atomic operations

XMLWordPrintable

    • gc
    • b11

      G1EvacStats uses atomic operations like:
        Atomic::add(&_direct_allocated, value);

      This causes the default barriers to be used:

        // Returns updated value.
        template<typename D, typename I>
        inline static D add(D volatile* dest, I add_value,
                            atomic_memory_order order = memory_order_conservative);

      Since these are stats, we can use memory_order_relaxed and get a tiny improvement for gathering stats. (I doubt it would show on benchmarks, this is a paper-cut issue.)

            btaylor Ben Taylor
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: