Review Request for 6878481: Add performance counters in the JDK

Mandy Chung Mandy.Chung at Sun.COM
Thu Sep 3 16:13:01 UTC 2009

Alan Bateman wrote:
> Andrew John Hughes wrote:
>> :
>> The use of synchronized at present seems flawed as only the set
>> methods are protected and not the get.  So lb.get could be called
>> while in an lb.put call.  I don't see the reason for using a
>> LongBuffer either, as only index 0 is ever used.  Why not use an
>> AtomicLong?
> The LongBuffer is a direct buffer with a reference to memory in the 
> PerfData instrumentation buffer. This is the shared memory that 
> jvmstat clients (jstat, VisualVM , ..) will attach to in order to 
> monitor the VM.
I can add synchronized in the get method.  The PerfData instrumentation 
buffer is designed to be read by another process such as jstat tool so 
that we can monitor a running VM without  interfering its execution.
>> What is the purpose of d3dAvailable?  I don't know this piece of code
>> so I'm not sure what it's counting, but it will presumably be zero
>> forever on non-Windows systems.
> Mandy can say more about this, but it essentially allows jstat to see 
> if the target VM is using the D3D pipeline or not.
Exactly.  D3D pipeline is not always available on all Windows machines 
and it depends on the graphic board, the OS version, and other 
configuration.  We have been doing startup performance measurement on 
various systems and there is perf difference with D3D available or not.  
Adding a counter (it should be a constant counter) to indicate if D3D 
pipeline is available would be useful.

Note that d3dAvailable is only added when running on Windows.  On 
Solaris/Linux, ClientCounters class will not be initialized and thus 
d3dAvailable is not added.  I should add a comment to describe about 
platform-specific counters or optional counters.

> -Alan.

More information about the core-libs-dev mailing list