jmm.h revision 2976
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*/
#include "jni.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
JMM_VERSION_1 = 0x20010000,
JMM_VERSION_1_0 = 0x20010000,
JMM_VERSION = 0x20010202
};
typedef struct {
unsigned int isLowMemoryDetectionSupported : 1;
unsigned int isCompilationTimeMonitoringSupported : 1;
unsigned int isThreadContentionMonitoringSupported : 1;
unsigned int isCurrentThreadCpuTimeSupported : 1;
unsigned int isOtherThreadCpuTimeSupported : 1;
unsigned int isBootClassPathSupported : 1;
unsigned int isObjectMonitorUsageSupported : 1;
unsigned int isSynchronizerUsageSupported : 1;
unsigned int isThreadAllocatedMemorySupported : 1;
unsigned int : 23;
typedef enum {
JMM_INTERNAL_ATTRIBUTE_INDEX = 100,
JMM_OS_ATTRIBUTE_INDEX = 200,
JMM_GC_EXT_ATTRIBUTE_INFO_SIZE = 401 /* the size of the GC specific attributes for a given GC memory manager */
typedef enum {
JMM_VERBOSE_GC = 21,
JMM_VERBOSE_CLASS = 22,
JMM_THREAD_CPU_TIME = 24,
enum {
JMM_THREAD_STATE_FLAG_SUSPENDED = 0x00100000,
JMM_THREAD_STATE_FLAG_NATIVE = 0x00400000
};
#define JMM_THREAD_STATE_FLAG_MASK 0xFFF00000
typedef enum {
JMM_STAT_PEAK_THREAD_COUNT = 801,
JMM_STAT_PEAK_POOL_USAGE = 805,
JMM_STAT_GC_STAT = 806
typedef enum {
JMM_USAGE_THRESHOLD_HIGH = 901,
JMM_USAGE_THRESHOLD_LOW = 902,
/* Should match what is allowed in globals.hpp */
typedef enum {
typedef enum {
typedef struct {
unsigned int reserved : 30;
void *reserved1;
void *reserved2;
} jmmVMGlobal;
typedef struct {
const char* name;
char type;
const char* description;
/* 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
*/
typedef struct {
/* -1 indicates gc_ext_attribute_values is not big enough */
} jmmGCStat;
typedef struct {
const char* name;
const char* description;
const char* impact;
int num_arguments;
} dcmdInfo;
typedef struct {
const char* name;
const char* description;
const char* type;
const char* default_string;
int position;
} dcmdArgInfo;
typedef struct jmmInterface_1_ {
void* reserved1;
void* reserved2;
/* This is used by JDK 6 and earlier.
* For JDK 7 and after, use GetInputArgumentArray.
*/
void (JNICALL *GetThreadAllocatedMemory)
// Not used in JDK 6 or JDK 7
void (JNICALL *GetThreadCpuTimesWithKind)
void* reserved6;
void (JNICALL *GetDiagnosticCommandInfo)
} JmmInterface;
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* !_JAVA_JMM_H_ */