public interface OperatingSystemMXBean extends OperatingSystemMXBean
OpenJ9 platform management extension interface for the Operating System on which the Java Virtual Machine is running.
OperatingSystemMXBean
...
com.ibm.lang.management.OperatingSystemMXBean osmxbean = null;
osmxbean = (com.ibm.lang.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
...
| Method | Return Value |
|---|---|
getCommittedVirtualMemorySize() |
-1 |
OperatingSystemMXBean.getFreePhysicalMemorySize() |
-1 |
getProcessPhysicalMemorySize() |
-1 |
getProcessPrivateMemorySize() |
-1 |
OperatingSystemMXBean.getSystemCpuLoad() |
-3.0 (CpuLoadCalculationConstants.UNSUPPORTED_VALUE) |
CpuLoadCalculationConstants| Modifier and Type | Method and Description |
|---|---|
long |
getCommittedVirtualMemorySize()
Returns the amount of virtual memory used by the process in bytes.
|
long |
getFreeSwapSpaceSize()
Returns the amount of free swap space in bytes.
|
String |
getHardwareModel()
Instantiates and returns an instance of a
String object containing
hardware model information |
double |
getProcessCpuLoad()
Returns the recent CPU usage for the Java Virtual Machine process.
|
long |
getProcessCpuTime()
Returns total amount of time the process has been scheduled or
executed so far in both kernel and user modes.
|
long |
getProcessCpuTimeByNS()
Deprecated.
|
int |
getProcessingCapacity()
Returns the collective capacity of the virtual processors in
the partition the VM is running in.
|
long |
getProcessPhysicalMemorySize()
Returns the amount of physical memory being used by the process
in bytes.
|
long |
getProcessPrivateMemorySize()
Returns the amount of private memory used by the process in bytes.
|
long |
getProcessVirtualMemorySize()
Deprecated.
|
long |
getTotalPhysicalMemory()
Deprecated.
|
long |
getTotalSwapSpaceSize()
Returns the total amount of swap space in bytes.
|
boolean |
isHardwareEmulated()
Identify whether the underlying hardware is being emulated
|
boolean |
isProcessRunning(long pid)
Indicates if the specified process is running
|
MemoryUsage |
retrieveMemoryUsage()
Instantiates and returns an instance of
MemoryUsage object
that represents the current snapshot of Memory usage statistics. |
MemoryUsage |
retrieveMemoryUsage(MemoryUsage memObj)
Returns an updated
MemoryUsage object that represents the
current snapshot of Memory usage statistics. |
ProcessorUsage[] |
retrieveProcessorUsage()
Instantiates and returns an array of
ProcessorUsage objects
that represent the current snapshot of individual Processor usage times. |
ProcessorUsage[] |
retrieveProcessorUsage(ProcessorUsage[] procArray)
Returns an updated array of
ProcessorUsage objects
that represent the current snapshot of individual Processor usage times. |
ProcessorUsage |
retrieveTotalProcessorUsage()
Instantiate and return a new
ProcessorUsage object that
represents the current snapshot of Processor usage statistics. |
ProcessorUsage |
retrieveTotalProcessorUsage(ProcessorUsage procObj)
Returns an updated
ProcessorUsage object that represents the
current snapshot of Processor usage statistics. |
getFreePhysicalMemorySize, getSystemCpuLoad, getTotalPhysicalMemorySizegetArch, getAvailableProcessors, getName, getSystemLoadAverage, getVersiongetObjectName@Deprecated long getTotalPhysicalMemory()
int getProcessingCapacity()
long getProcessCpuTime()
@Deprecated long getProcessCpuTimeByNS()
long getCommittedVirtualMemorySize()
@Deprecated long getProcessVirtualMemorySize()
long getProcessPrivateMemorySize()
long getProcessPhysicalMemorySize()
long getTotalSwapSpaceSize()
long getFreeSwapSpaceSize()
double getProcessCpuLoad()
CpuLoadCalculationConstants.ERROR_VALUE
(-1.0), which marks the starting point. If the Java Virtual Machine's recent CPU
usage is not available, the method returns a negative error code from
CpuLoadCalculationConstants.CpuLoadCalculationConstants in case
of an error. On the first call to the API,
CpuLoadCalculationConstants.ERROR_VALUE
(-1.0) shall be returned.CpuLoadCalculationConstantsProcessorUsage retrieveTotalProcessorUsage(ProcessorUsage procObj) throws NullPointerException, ProcessorUsageRetrievalException
ProcessorUsage object that represents the
current snapshot of Processor usage statistics. The snapshot is the aggregate of all
Processors that are online at the time of sampling.procObj - User provided ProcessorUsage object.ProcessorUsage object.NullPointerException - if a null reference is passed as parameter.ProcessorUsageRetrievalException - if it failed obtaining Processor usage statistics.
In case of an exception, the handler code might use toString() on the exception code to obtain a description of the exception.
ProcessorUsage retrieveTotalProcessorUsage() throws ProcessorUsageRetrievalException
ProcessorUsage object that
represents the current snapshot of Processor usage statistics. The snapshot is the
aggregate of all Processors that are online at the time of sampling.ProcessorUsage object.ProcessorUsageRetrievalException - if it failed obtaining Processor usage statistics.
In case of an exception, the handler code might use toString() on the exception code to obtain a description of the exception.
ProcessorUsage[] retrieveProcessorUsage(ProcessorUsage[] procArray) throws NullPointerException, ProcessorUsageRetrievalException, IllegalArgumentException
ProcessorUsage objects
that represent the current snapshot of individual Processor usage times.procArray - User provided array of ProcessorUsage objects.ProcessorUsage objects.NullPointerException - if a null reference is passed as parameter.ProcessorUsageRetrievalException - if it failed obtaining Processor usage statistics.IllegalArgumentException - if array provided has insufficient entries and there are more
Processors to report on.
In case of an exception, the handler code might use toString() on the exception code to obtain a description of the exception.
ProcessorUsage[] retrieveProcessorUsage() throws ProcessorUsageRetrievalException
ProcessorUsage objects
that represent the current snapshot of individual Processor usage times.ProcessorUsage objects.ProcessorUsageRetrievalException - if it failed obtaining Processor usage statistics.
In case of an exception, the handler code might use toString() on the exception code to obtain a description of the exception.
MemoryUsage retrieveMemoryUsage(MemoryUsage memObj) throws NullPointerException, MemoryUsageRetrievalException
MemoryUsage object that represents the
current snapshot of Memory usage statistics.memObj - User provided MemoryUsage object.MemoryUsage object.NullPointerException - if a null reference is passed as parameter.MemoryUsageRetrievalException - if it failed obtaining Memory usage statistics.
In case of an exception, the handler code might use toString() on the exception code to obtain a description of the exception.
MemoryUsage retrieveMemoryUsage() throws MemoryUsageRetrievalException
MemoryUsage object
that represents the current snapshot of Memory usage statistics.MemoryUsage object.MemoryUsageRetrievalException - if it failed obtaining Memory usage statistics.
In case of an exception, the handler code might use toString() on the exception code to obtain a description of the exception.
String getHardwareModel() throws UnsupportedOperationException
String object containing
hardware model informationString object or NULL in case of an error.UnsupportedOperationException - if the operation is not implemented on this platform.
UnsupportedOperationException will also be thrown if the operation is implemented but it
cannot be performed because the system does not satisfy all the requirements, for example,
an OS service is not installed.boolean isHardwareEmulated()
throws UnsupportedOperationException
UnsupportedOperationException - if the emulated status cannot be determinedboolean isProcessRunning(long pid)
pid - Operating system process IDEclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2001, 2025 IBM Corp. and others.