Modifier and Type | Field and Description |
---|---|
private static boolean |
aarch64 |
private static boolean |
amd64 |
private static boolean |
ibmvendor |
private static int |
JVM_SPEC_VERSION
The Integer represent of JVM_SPEC_VERSION, for the JVM version comparison.
|
private static String |
JVM_SPEC_VERSION_STRING
The raw String of java specification version.
|
private static String |
JVMVersion |
private static boolean |
linux |
private static org.slf4j.Logger |
LOG |
private OperatingSystemMXBean |
osMbean |
private static boolean |
windows |
Constructor and Description |
---|
JVM()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
getFreeMemory()
Return the physical free memory (not the JVM one, as it's not very useful as it depends on the
GC), but the one from the OS as it allows a little bit more to guess if the machine is
overloaded or not).
|
static int |
getJVMSpecVersion() |
long |
getMaxFileDescriptorCount()
Get the number of the maximum file descriptors the system can use.
|
int |
getNumberOfRunningProcess()
Workaround to get the current number of process running.
|
long |
getOpenFileDescriptorCount()
Get the number of opened filed descriptor for the runtime jvm.
|
double |
getSystemLoadAverage()
Get the system load average
|
static boolean |
isAarch64()
Check if the arch is aarch64;
|
static boolean |
isAmd64()
Check if the arch is amd64;
|
static boolean |
isGZIPOutputStreamFinishBroken()
Check if the finish() method of GZIPOutputStream is broken
|
static boolean |
isLinux()
Check if the OS is linux.
|
static boolean |
isUnix()
Check if the OS is unix.
|
private Long |
runUnixMXBeanMethod(String mBeanMethodName)
Load the implementation of UnixOperatingSystemMXBean for Oracle jvm and runs the desired
method.
|
private static final org.slf4j.Logger LOG
private OperatingSystemMXBean osMbean
private static final boolean ibmvendor
private static final boolean windows
private static final boolean linux
private static final boolean amd64
private static final boolean aarch64
private static final String JVMVersion
private static final String JVM_SPEC_VERSION_STRING
private static final int JVM_SPEC_VERSION
public JVM()
public static boolean isUnix()
public static boolean isLinux()
public static boolean isAmd64()
public static boolean isAarch64()
public static boolean isGZIPOutputStreamFinishBroken()
public static int getJVMSpecVersion()
private Long runUnixMXBeanMethod(String mBeanMethodName)
mBeanMethodName
- : method to run from the interface UnixOperatingSystemMXBeanpublic long getOpenFileDescriptorCount()
public double getSystemLoadAverage()
public long getFreeMemory()
public int getNumberOfRunningProcess()
public long getMaxFileDescriptorCount()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.