Review Request for 6878481: Add performance counters in the JDK

Mandy Chung Mandy.Chung at Sun.COM
Thu Sep 3 18:36:48 UTC 2009


David Holmes - Sun Microsystems wrote:
> Hi Mandy,
>
> Mandy Chung said the following on 09/03/09 05:25:
>> This is related to 6857194: Add hotspot new perf counters to aid 
>> class loading performance measurement.
>>
>> It's useful to add performance counters in the library code so that 
>> perf data from the JDK and VM can be collected and output in a 
>> unified way (written in the jvmstat shared memory buffer).  I add a 
>> simple sun.misc.PerfCounter class to maintain the list of perf 
>> counters for the library to use.  This fix only instruments the class 
>> loading and jar/zip to collect simple basic metrics.   Additional 
>> perf counters will be added in the future.
>>
>> Webrev:
>>     http://cr.openjdk.java.net/~mchung/6878481/webrev.00/
>
> What is the performance overhead here? This seems like a lot of extra 
> code if you don't want to read the counters. Is there not some way to 
> only conditionally enable them?
I ran the server benchmarks and the Windows XP result shows negligible 
difference.  I'm rerunning my solaris-i586 measurement (I got high diff 
in the standard deviation from my previous runs).

Windows XP SP 3 Intel Core 2 CPU @3.0Ghz, 1.96 GB RAM

==============================================================================
mchung.baseline.server:
  Benchmark           Samples        Mean     Stdev             Geomean 
Weight
  reference_server         11     7591.49     38.91
    jetstream              11      125.58      1.24             0.10
    scimark                11      619.94      4.86             0.15
    specjbb2000            11    94540.14    493.47             0.15
    specjbb2005            11    43320.15    193.86             0.25
    specjvm98              11      577.06      1.74             0.15
    volano25               11    45661.45   1146.69             0.20
==============================================================================
mchung.perfcounters:
  Benchmark           Samples        Mean     Stdev   %Diff     P  
Significant
  reference_server         11     7588.94     48.89   -0.03 
0.893            *
    jetstream              11      125.57      0.88   -0.00 
0.990            *
    scimark                11      616.95      5.78   -0.48 
0.203            *
    specjbb2000            11    94040.74    385.93   -0.53 
0.016            *
    specjbb2005            11    43166.00    191.27   -0.36 
0.075            *
    specjvm98              11      577.39      1.69    0.06 
0.654            *
    volano25               11    46119.64   1259.95    1.00 
0.383            *
==============================================================================
  * - Not Significant: A non-zero %Diff for the mean could be noise. If the
      %Diff is 0, an actual difference may still exist. In either case, more
      samples would be needed to detect an actual difference in sample 
means.

To provide a way to enable I can't think of a better way other than 
adding the conditional check in the new calls I add.
>
> We're sticking in a lot of System.nanoTime() calls and on some systems 
> it isn't necessarily cheap eg Windows - see 6440250. Even if it is 
> cheap, there are potentially a lot of them in classloading intensive 
> situations.
>
Thanks for the CR#.  FYI. The hotspot VM has a "sun.os.hrt.frequency" 
perf counter to store the QueryPerformanceFrequency.  The system used 
for the benchmark runs has the value of 2,992,550,000.

I am going to find a system using ACPI PMT and run the benchmarks to 
measure its overhead after revising the fix to reduce the number of 
System.nanoTime() calls.

Thanks
Mandy
> David




More information about the core-libs-dev mailing list