RFR: 8007806: Need a Throwables performance counter

David Holmes david.holmes at oracle.com
Sat Feb 23 23:35:42 UTC 2013

On 24/02/2013 6:08 AM, Alan Bateman wrote:
> On 23/02/2013 19:39, Peter Levart wrote:
>> Hi Nils,
>> If the counters are updated frequently from multiple threads, there
>> might be contention/scalability issues. Instead of synchronization on
>> updates, you might consider using atomic updates provided by
>> sun.misc.Unsafe, like for example:
> Most of the jvmstat counters are in VM and we only update a small number
> of counters in the libraries. Even so, I think your idea is good as
> further usage could potentially to be an issue, particularly
> add/increment (which involves a get at this). So irrespective of Nil's
> patch (which I think is now just a proposal to add a counter, not
> original patch that Jason was commenting on) then we should take your
> patch.

Before we rush down this path. Atomic operations on 64-bit types are not 
supported natively on all 32-bit platforms. Atomic updates on those 
platforms will degenerate into locking - which is the barrier to 
implementing frequently used counters in the first place.


> -Alan

More information about the core-libs-dev mailing list