Review Request for 6878481: Add performance counters in the JDK
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.
> 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
Benchmark Samples Mean Stdev Geomean
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
Benchmark Samples Mean Stdev %Diff P
reference_server 11 7588.94 48.89 -0.03
jetstream 11 125.57 0.88 -0.00
scimark 11 616.95 5.78 -0.48
specjbb2000 11 94040.74 385.93 -0.53
specjbb2005 11 43166.00 191.27 -0.36
specjvm98 11 577.39 1.69 0.06
volano25 11 46119.64 1259.95 1.00
* - 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
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
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
More information about the core-libs-dev