1 This is an example of j_cpudist.d showing the elapsed times for different
2 types of Java operations.
4 This traces activity from all Java processes on the system with hotspot
5 provider support (1.6.0), and produces the output in graphical format, showing
6 a histogram of the amount of time taken by each call. Method calls are only
7 visible when using the flag "+ExtendedDTraceProbes". eg,
8 java -XX:+ExtendedDTraceProbes classfile
10 Because of the extensive results returned otherwise, this script will show you
11 a configurable number of results in each section. The default (as in this
14 Here we see it tracing the activity of Code/Java/Func_abc.
17 Tracing... Hit Ctrl-C to end.
20 Top 10 on-CPU times (us),
22 Top 10 exclusive method on-CPU times (us),
23 PID=311364, method, java/lang/AbstractStringBuilder.append
24 value ------------- Distribution ------------- count
26 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 382
34 PID=311364, method, java/util/Arrays.copyOf
35 value ------------- Distribution ------------- count
37 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 68
47 PID=311364, method, java/io/UnixFileSystem.normalize
48 value ------------- Distribution ------------- count
59 PID=311364, method, java/io/File.<clinit>
60 value ------------- Distribution ------------- count
62 1024 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
65 PID=311364, method, sun/misc/URLClassPath$JarLoader.getJarFile
66 value ------------- Distribution ------------- count
68 1024 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
71 PID=311364, method, java/io/FilePermission$1.run
72 value ------------- Distribution ------------- count
74 2 |@@@@@@@@@@@@@@@@@@@@ 2
86 PID=311364, method, java/lang/StringBuilder.append
87 value ------------- Distribution ------------- count
89 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 526
96 PID=311364, method, java/lang/String.<init>
97 value ------------- Distribution ------------- count
99 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 162
111 PID=311364, method, java/lang/String.charAt
112 value ------------- Distribution ------------- count
114 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1953
121 PID=311364, method, java/lang/System.initializeSystemClass
122 value ------------- Distribution ------------- count
124 2048 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
128 Top 10 inclusive method on-CPU times (us),
129 PID=311364, method, sun/misc/Launcher$ExtClassLoader.<init>
130 value ------------- Distribution ------------- count
132 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
135 PID=311364, method, sun/misc/Launcher$ExtClassLoader.getExtClassLoader
136 value ------------- Distribution ------------- count
138 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
141 PID=311364, method, sun/misc/Launcher$ExtClassLoader.getExtURLs
142 value ------------- Distribution ------------- count
144 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
147 PID=311364, method, sun/misc/Launcher.<clinit>
148 value ------------- Distribution ------------- count
150 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
153 PID=311364, method, sun/misc/Launcher.<init>
154 value ------------- Distribution ------------- count
156 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
159 PID=311364, method, java/lang/ClassLoader.loadClassInternal
160 value ------------- Distribution ------------- count
162 64 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
173 PID=311364, method, sun/misc/Launcher$AppClassLoader.loadClass
174 value ------------- Distribution ------------- count
176 64 |@@@@@@@@@@@@@@@@@@@@@@@@@@@ 6
187 PID=311364, method, sun/misc/URLClassPath.getLoader
188 value ------------- Distribution ------------- count
197 512 |@@@@@@@@@@@@@@@@@@@@@@ 7
204 PID=311364, method, java/lang/ClassLoader.loadClass
205 value ------------- Distribution ------------- count
208 64 |@@@@@@@@@@@@@@@@@@@@@ 14
219 PID=311364, method, java/security/AccessController.doPrivileged
220 value ------------- Distribution ------------- count
237 The elapsed times section is empty. It would show us anything that is not a
238 Java method - garbage collection for example. However there was nothing of
239 the kind in this example.
241 The exclusive method elapsed times show us the time spent on-CPU by the most
242 time consuming methods, not including time spent in subroutines called by
245 The inclusive method elapsed times show us the time spent on-CPU by the top
246 ten most time consuming methods including time spent in subroutines called by
249 It is important to pay close attention to the third column, "count" as this
250 will indicate if there were any instances in a particular timeframe, even if
251 the number is too small to show up on the histogram clearly.