Package org.ehcache.sizeof.impl
Enum JvmInformation
- java.lang.Object
-
- java.lang.Enum<JvmInformation>
-
- org.ehcache.sizeof.impl.JvmInformation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<JvmInformation>
public enum JvmInformation extends java.lang.Enum<JvmInformation>
Detects and represents JVM-specific properties that relate to the memory data model for java objects that are useful for size of calculations.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description HOTSPOT_32_BIT
Represents HotSpot 32-bitHOTSPOT_32_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 32-Bit HotSpot JVM with Concurrent Mark-and-Sweep GCHOTSPOT_64_BIT
Represents 64-Bit HotSpot JVMHOTSPOT_64_BIT_WITH_COMPRESSED_OOPS
Represents 64-Bit HotSpot JVM with Compressed OOPsHOTSPOT_64_BIT_WITH_COMPRESSED_OOPS_AND_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit HotSpot JVM with Compressed OOPs and Concurrent Mark-and-Sweep GCHOTSPOT_64_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit HotSpot JVM with Concurrent Mark-and-Sweep GCIBM_32_BIT
Represents IBM 32-bitIBM_64_BIT
Represents 64-Bit IBM JVM (with no reference compression)IBM_64_BIT_WITH_COMPRESSED_REFS
Represents 64-Bit IBM JVM (with reference compression)OPENJDK_32_BIT
Represents OpenJDK 32-bitOPENJDK_32_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 32-Bit OpenJDK JVM with Concurrent Mark-and-Sweep GCOPENJDK_64_BIT
Represents 64-Bit OpenJDK JVMOPENJDK_64_BIT_WITH_COMPRESSED_OOPS
Represents 64-Bit OpenJDK JVM with Compressed OOPsOPENJDK_64_BIT_WITH_COMPRESSED_OOPS_AND_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit OpenJDK JVM with Compressed OOPs and Concurrent Mark-and-Sweep GCOPENJDK_64_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit OpenJDK JVM with Concurrent Mark-and-Sweep GCUNKNOWN_32_BIT
Represents Generic 32-bitUNKNOWN_64_BIT
Represents 64-Bit Generic JVM
-
Field Summary
Fields Modifier and Type Field Description static JvmInformation
CURRENT_JVM_INFORMATION
The JvmInformation instance representing the current JVMprivate static long
FIFTY_SEVEN_GB
private static org.slf4j.Logger
LOGGER
private JvmInformation
parent
private static long
TWENTY_FIVE_GB
-
Constructor Summary
Constructors Modifier Constructor Description private
JvmInformation(JvmInformation parent)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static JvmInformation
detectHotSpot()
private static JvmInformation
detectIBM()
private static JvmInformation
detectOpenJDK()
int
getAgentSizeOfAdjustment()
The size of the jvm-specific agent result adjustment in bytes.int
getFieldOffsetAdjustment()
The size of the jvm-specific field offset adjustment in bytes.private static java.lang.String
getHotSpotVmOptionValue(java.lang.String name)
int
getJavaPointerSize()
Size of a java pointer in bytes on this runtime (that differs when compressedOops are being used)private static java.lang.String
getJRockitVmArgs()
abstract java.lang.String
getJvmDescription()
A human-readable description of the JVM and its relevant enabled options.Osprivate static JvmInformation
getJvmInformation()
Determine the JvmInformation for the current JVM.int
getMinimumObjectSize()
Minimal size an object will occupy on the heap in bytes.int
getObjectAlignment()
Object alignment / padding in bytesint
getObjectHeaderSize()
The size of an object header in bytes.private static java.lang.String
getPlatformMBeanAttribute(java.lang.String beanName, java.lang.String attrName)
int
getPointerSize()
Size of a pointer in bytes on this runtimeprivate static boolean
is64Bit()
static boolean
isHotspot()
Returns true if VM vendor is Hotspotprivate static boolean
isHotspotCompressedOops()
private static boolean
isHotspotConcurrentMarkSweepGC()
static boolean
isIBM()
Returns true if VM vendor is IBMprivate static boolean
isIBMCompressedRefs()
static boolean
isJRockit()
Returns true if VM is JRockitprivate static boolean
isJRockit64GBCompression()
static boolean
isOpenJDK()
Returns true if VM vendor is OpenJDKstatic boolean
isOSX()
Return true if the VM's vendor is Appleboolean
supportsAgentSizeOf()
Whether the jvm can support AgentSizeOf implementation.boolean
supportsReflectionSizeOf()
Whether the jvm can support ReflectionSizeOf implementation.boolean
supportsUnsafeSizeOf()
Whether the jvm can support UnsafeSizeOf implementation.static JvmInformation
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static JvmInformation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN_32_BIT
public static final JvmInformation UNKNOWN_32_BIT
Represents Generic 32-bit
-
UNKNOWN_64_BIT
public static final JvmInformation UNKNOWN_64_BIT
Represents 64-Bit Generic JVM
-
HOTSPOT_32_BIT
public static final JvmInformation HOTSPOT_32_BIT
Represents HotSpot 32-bit
-
HOTSPOT_32_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
public static final JvmInformation HOTSPOT_32_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 32-Bit HotSpot JVM with Concurrent Mark-and-Sweep GC
-
HOTSPOT_64_BIT
public static final JvmInformation HOTSPOT_64_BIT
Represents 64-Bit HotSpot JVM
-
HOTSPOT_64_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
public static final JvmInformation HOTSPOT_64_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit HotSpot JVM with Concurrent Mark-and-Sweep GC
-
HOTSPOT_64_BIT_WITH_COMPRESSED_OOPS
public static final JvmInformation HOTSPOT_64_BIT_WITH_COMPRESSED_OOPS
Represents 64-Bit HotSpot JVM with Compressed OOPs
-
HOTSPOT_64_BIT_WITH_COMPRESSED_OOPS_AND_CONCURRENT_MARK_AND_SWEEP
public static final JvmInformation HOTSPOT_64_BIT_WITH_COMPRESSED_OOPS_AND_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit HotSpot JVM with Compressed OOPs and Concurrent Mark-and-Sweep GC
-
OPENJDK_32_BIT
public static final JvmInformation OPENJDK_32_BIT
Represents OpenJDK 32-bit
-
OPENJDK_32_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
public static final JvmInformation OPENJDK_32_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 32-Bit OpenJDK JVM with Concurrent Mark-and-Sweep GC
-
OPENJDK_64_BIT
public static final JvmInformation OPENJDK_64_BIT
Represents 64-Bit OpenJDK JVM
-
OPENJDK_64_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
public static final JvmInformation OPENJDK_64_BIT_WITH_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit OpenJDK JVM with Concurrent Mark-and-Sweep GC
-
OPENJDK_64_BIT_WITH_COMPRESSED_OOPS
public static final JvmInformation OPENJDK_64_BIT_WITH_COMPRESSED_OOPS
Represents 64-Bit OpenJDK JVM with Compressed OOPs
-
OPENJDK_64_BIT_WITH_COMPRESSED_OOPS_AND_CONCURRENT_MARK_AND_SWEEP
public static final JvmInformation OPENJDK_64_BIT_WITH_COMPRESSED_OOPS_AND_CONCURRENT_MARK_AND_SWEEP
Represents 64-Bit OpenJDK JVM with Compressed OOPs and Concurrent Mark-and-Sweep GC
-
IBM_32_BIT
public static final JvmInformation IBM_32_BIT
Represents IBM 32-bit
-
IBM_64_BIT
public static final JvmInformation IBM_64_BIT
Represents 64-Bit IBM JVM (with no reference compression)
-
IBM_64_BIT_WITH_COMPRESSED_REFS
public static final JvmInformation IBM_64_BIT_WITH_COMPRESSED_REFS
Represents 64-Bit IBM JVM (with reference compression)
-
-
Field Detail
-
CURRENT_JVM_INFORMATION
public static final JvmInformation CURRENT_JVM_INFORMATION
The JvmInformation instance representing the current JVM
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
TWENTY_FIVE_GB
private static final long TWENTY_FIVE_GB
- See Also:
- Constant Field Values
-
FIFTY_SEVEN_GB
private static final long FIFTY_SEVEN_GB
- See Also:
- Constant Field Values
-
parent
private JvmInformation parent
-
-
Constructor Detail
-
JvmInformation
private JvmInformation(JvmInformation parent)
-
-
Method Detail
-
values
public static JvmInformation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JvmInformation c : JvmInformation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JvmInformation valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getPointerSize
public int getPointerSize()
Size of a pointer in bytes on this runtime
-
getJavaPointerSize
public int getJavaPointerSize()
Size of a java pointer in bytes on this runtime (that differs when compressedOops are being used)
-
getMinimumObjectSize
public int getMinimumObjectSize()
Minimal size an object will occupy on the heap in bytes.
-
getObjectAlignment
public int getObjectAlignment()
Object alignment / padding in bytes
-
getObjectHeaderSize
public int getObjectHeaderSize()
The size of an object header in bytes.
-
getFieldOffsetAdjustment
public int getFieldOffsetAdjustment()
The size of the jvm-specific field offset adjustment in bytes.
-
getAgentSizeOfAdjustment
public int getAgentSizeOfAdjustment()
The size of the jvm-specific agent result adjustment in bytes.
-
supportsAgentSizeOf
public boolean supportsAgentSizeOf()
Whether the jvm can support AgentSizeOf implementation.
-
supportsUnsafeSizeOf
public boolean supportsUnsafeSizeOf()
Whether the jvm can support UnsafeSizeOf implementation.
-
supportsReflectionSizeOf
public boolean supportsReflectionSizeOf()
Whether the jvm can support ReflectionSizeOf implementation.
-
getJvmDescription
public abstract java.lang.String getJvmDescription()
A human-readable description of the JVM and its relevant enabled options.Os
-
getJvmInformation
private static JvmInformation getJvmInformation()
Determine the JvmInformation for the current JVM.
-
detectHotSpot
private static JvmInformation detectHotSpot()
-
detectOpenJDK
private static JvmInformation detectOpenJDK()
-
detectIBM
private static JvmInformation detectIBM()
-
isJRockit64GBCompression
private static boolean isJRockit64GBCompression()
-
isJRockit
public static boolean isJRockit()
Returns true if VM is JRockit- Returns:
- true, if JRockit
-
isOSX
public static boolean isOSX()
Return true if the VM's vendor is Apple- Returns:
- true, if OS X
-
isHotspot
public static boolean isHotspot()
Returns true if VM vendor is Hotspot- Returns:
- true, if Hotspot
-
isOpenJDK
public static boolean isOpenJDK()
Returns true if VM vendor is OpenJDK- Returns:
- true, if OpenJDK
-
isIBM
public static boolean isIBM()
Returns true if VM vendor is IBM- Returns:
- true, if IBM
-
isIBMCompressedRefs
private static boolean isIBMCompressedRefs()
-
isHotspotCompressedOops
private static boolean isHotspotCompressedOops()
-
getHotSpotVmOptionValue
private static java.lang.String getHotSpotVmOptionValue(java.lang.String name)
-
getPlatformMBeanAttribute
private static java.lang.String getPlatformMBeanAttribute(java.lang.String beanName, java.lang.String attrName)
-
getJRockitVmArgs
private static java.lang.String getJRockitVmArgs()
-
isHotspotConcurrentMarkSweepGC
private static boolean isHotspotConcurrentMarkSweepGC()
-
is64Bit
private static boolean is64Bit()
-
-