20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package sun.misc;
27
28 import java.nio.ByteBuffer;
29 import java.nio.ByteOrder;
30 import java.nio.LongBuffer;
31 import java.security.AccessController;
32
33 /**
34 * Performance counter support for internal JRE classes.
35 * This class defines a fixed list of counters for the platform
36 * to use as an interim solution until RFE# 6209222 is implemented.
37 * The perf counters will be created in the jvmstat perf buffer
38 * that the HotSpot VM creates. The default size is 32K and thus
39 * the number of counters is bounded. You can alter the size
40 * with -XX:PerfDataMemorySize=<bytes> option. If there is
41 * insufficient memory in the jvmstat perf buffer, the C heap memory
42 * will be used and thus the application will continue to run if
43 * the counters added exceeds the buffer size but the counters
44 * will be missing.
45 *
46 * See HotSpot jvmstat implementation for certain circumstances
47 * that the jvmstat perf buffer is not supported.
48 *
49 */
50 public class PerfCounter {
51 private static final Perf perf =
52 AccessController.doPrivileged(new Perf.GetPerfAction());
53
54 // Must match values defined in hotspot/src/share/vm/runtime/perfdata.hpp
55 private final static int V_Constant = 1;
56 private final static int V_Monotonic = 2;
57 private final static int V_Variable = 3;
58 private final static int U_None = 1;
59
60 private final String name;
|
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package sun.misc;
27
28 import java.nio.ByteBuffer;
29 import java.nio.ByteOrder;
30 import java.nio.LongBuffer;
31 import java.security.AccessController;
32
33 /**
34 * Performance counter support for internal JRE classes.
35 * This class defines a fixed list of counters for the platform
36 * to use as an interim solution until RFE# 6209222 is implemented.
37 * The perf counters will be created in the jvmstat perf buffer
38 * that the HotSpot VM creates. The default size is 32K and thus
39 * the number of counters is bounded. You can alter the size
40 * with {@code -XX:PerfDataMemorySize=<bytes>} option. If there is
41 * insufficient memory in the jvmstat perf buffer, the C heap memory
42 * will be used and thus the application will continue to run if
43 * the counters added exceeds the buffer size but the counters
44 * will be missing.
45 *
46 * See HotSpot jvmstat implementation for certain circumstances
47 * that the jvmstat perf buffer is not supported.
48 *
49 */
50 public class PerfCounter {
51 private static final Perf perf =
52 AccessController.doPrivileged(new Perf.GetPerfAction());
53
54 // Must match values defined in hotspot/src/share/vm/runtime/perfdata.hpp
55 private final static int V_Constant = 1;
56 private final static int V_Monotonic = 2;
57 private final static int V_Variable = 3;
58 private final static int U_None = 1;
59
60 private final String name;
|