/* * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
#ifndef _JAVA_JMM_H_ #define _JAVA_JMM_H_
/* * This is a private interface used by JDK for JVM monitoring * and management. * * Bump the version number when either of the following happens: * * 1. There is a change in functions in JmmInterface. * * 2. There is a change in the contract between VM and Java classes.
*/
typedefenum {
JMM_CLASS_LOADED_COUNT = 1, /* Total number of loaded classes */
JMM_CLASS_UNLOADED_COUNT = 2, /* Total number of unloaded classes */
JMM_THREAD_TOTAL_COUNT = 3, /* Total number of threads that have been started */
JMM_THREAD_LIVE_COUNT = 4, /* Current number of live threads */
JMM_THREAD_PEAK_COUNT = 5, /* Peak number of live threads */
JMM_THREAD_DAEMON_COUNT = 6, /* Current number of daemon threads */
JMM_JVM_INIT_DONE_TIME_MS = 7, /* Time when the JVM finished initialization */
JMM_COMPILE_TOTAL_TIME_MS = 8, /* Total accumulated time spent in compilation */
JMM_GC_TIME_MS = 9, /* Total accumulated time spent in collection */
JMM_GC_COUNT = 10, /* Total number of collections */
JMM_JVM_UPTIME_MS = 11, /* The JVM uptime in milliseconds */
JMM_INTERNAL_ATTRIBUTE_INDEX = 100,
JMM_CLASS_LOADED_BYTES = 101, /* Number of bytes loaded instance classes */
JMM_CLASS_UNLOADED_BYTES = 102, /* Number of bytes unloaded instance classes */
JMM_TOTAL_CLASSLOAD_TIME_MS = 103, /* Accumulated VM class loader time */
JMM_VM_GLOBAL_COUNT = 104, /* Number of VM internal flags */
JMM_SAFEPOINT_COUNT = 105, /* Total number of safepoints */
JMM_TOTAL_SAFEPOINTSYNC_TIME_MS = 106, /* Accumulated time spent getting to safepoints */
JMM_TOTAL_STOPPED_TIME_MS = 107, /* Accumulated time spent at safepoints */
JMM_TOTAL_APP_TIME_MS = 108, /* Accumulated time spent in Java application */
JMM_VM_THREAD_COUNT = 109, /* Current number of VM internal threads */
JMM_CLASS_INIT_TOTAL_COUNT = 110, /* Number of classes for which initializers were run */
JMM_CLASS_INIT_TOTAL_TIME_MS = 111, /* Accumulated time spent in class initializers */
JMM_METHOD_DATA_SIZE_BYTES = 112, /* Size of method data in memory */
JMM_CLASS_VERIFY_TOTAL_TIME_MS = 113, /* Accumulated time spent in class verifier */
JMM_SHARED_CLASS_LOADED_COUNT = 114, /* Number of shared classes loaded */
JMM_SHARED_CLASS_UNLOADED_COUNT = 115, /* Number of shared classes unloaded */
JMM_SHARED_CLASS_LOADED_BYTES = 116, /* Number of bytes loaded shared classes */
JMM_SHARED_CLASS_UNLOADED_BYTES = 117, /* Number of bytes unloaded shared classes */
JMM_OS_ATTRIBUTE_INDEX = 200,
JMM_OS_PROCESS_ID = 201, /* Process id of the JVM */
JMM_OS_MEM_TOTAL_PHYSICAL_BYTES = 202, /* Physical memory size */
JMM_GC_EXT_ATTRIBUTE_INFO_SIZE = 401 /* the size of the GC specific attributes for a given GC memory manager */
} jmmLongAttribute;
/* Should match what is allowed in globals.hpp */ typedefenum {
JMM_VMGLOBAL_TYPE_UNKNOWN = 0,
JMM_VMGLOBAL_TYPE_JBOOLEAN = 1,
JMM_VMGLOBAL_TYPE_JSTRING = 2,
JMM_VMGLOBAL_TYPE_JLONG = 3,
JMM_VMGLOBAL_TYPE_JDOUBLE = 4
} jmmVMGlobalType;
typedefenum {
JMM_VMGLOBAL_ORIGIN_DEFAULT = 1, /* Default value */
JMM_VMGLOBAL_ORIGIN_COMMAND_LINE = 2, /* Set at command line (or JNI invocation) */
JMM_VMGLOBAL_ORIGIN_MANAGEMENT = 3, /* Set via management interface */
JMM_VMGLOBAL_ORIGIN_ENVIRON_VAR = 4, /* Set via environment variables */
JMM_VMGLOBAL_ORIGIN_CONFIG_FILE = 5, /* Set via config file (such as .hotspotrc) */
JMM_VMGLOBAL_ORIGIN_ERGONOMIC = 6, /* Set via ergonomic */
JMM_VMGLOBAL_ORIGIN_ATTACH_ON_DEMAND = 7, /* Set via attach */
JMM_VMGLOBAL_ORIGIN_OTHER = 99 /* Set via some other mechanism */
} jmmVMGlobalOrigin;
/* Caller has to set the following fields before calling GetLastGCStat * o usage_before_gc - array of MemoryUsage objects * o usage_after_gc - array of MemoryUsage objects * o gc_ext_attribute_values_size - size of gc_ext_atttribute_values array * o gc_ext_attribtue_values - array of jvalues
*/ typedefstruct {
jlong gc_index; /* Index of the collections */
jlong start_time; /* Start time of the GC */
jlong end_time; /* End time of the GC */
jobjectArray usage_before_gc; /* Memory usage array before GC */
jobjectArray usage_after_gc; /* Memory usage array after GC */
jint gc_ext_attribute_values_size; /* set by the caller of GetGCStat */
jvalue* gc_ext_attribute_values; /* Array of jvalue for GC extension attributes */
jint num_gc_ext_attributes; /* number of GC extension attribute values s are filled */ /* -1 indicates gc_ext_attribute_values is not big enough */
} jmmGCStat;
typedefstruct { constchar* name; /* Name of the diagnostic command */ constchar* description; /* Short description */ constchar* impact; /* Impact on the JVM */ constchar* permission_class; /* Class name of the required permission if any */ constchar* permission_name; /* Permission name of the required permission if any */ constchar* permission_action; /* Action name of the required permission if any*/ int num_arguments; /* Number of supported options or arguments */
jboolean enabled; /* True if the diagnostic command can be invoked, false otherwise*/
} dcmdInfo;
typedefstruct { constchar* name; /* Option/Argument name*/ constchar* description; /* Short description */ constchar* type; /* Type: STRING, BOOLEAN, etc. */ constchar* default_string; /* Default value in a parsable string */
jboolean mandatory; /* True if the option/argument is mandatory */
jboolean option; /* True if it is an option, false if it is an argument */ /* (see diagnosticFramework.hpp for option/argument definitions) */
jboolean multiple; /* True is the option can be specified several time */ int position; /* Expected position for this argument (this field is */ /* meaningless for options) */
} dcmdArgInfo;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.