JDK-6336608 : Ability to get system load average
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-10-13
  • Updated: 2017-05-16
  • Resolved: 2005-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6 b65Fixed
Related Reports
Relates :  
Need API to find out the overall system load.  E.g. amount of system CPU used and idle time.  Load average would be more useful to differentiate saturation from oversaturation.

EVALUATION The reason why this method is not supported on Windows is because the performance impact is too high. It requires to poll the run queue performance very frequently and calculate the system load average. The requirement is that this API needs to be on if supported. When Windows provide a light weight API to get the needed information, we could add the support.

SUGGESTED FIX Attached webrev.

EVALUATION A new method is added in java.lang.management.OperatingSystemMXBean interface: /** * Returns the system load average for the last minute. * The system load average is the sum of the number of runnable entity * queued to the {@linkplain #getAvailableProcessors available processors} * and the number of runnable entities running on the available processors * averaged over a period of time. * The way in which the load average is calculated is operating system * specific but is typically a damped time-dependent average. * <p> * If the load average was not available, a negative value is returned. * <p> * This method is designed to provide a hint about the system load * and may be queried frequently. * The load average may be unavailable on some platform where it is * expensive to implement this method. * * @return the system load average; or a negative value if not available. * * @since 1.6 */ public double getSystemLoadAverage(); Both linux and Solaris have an API to obtain load averages. There isn't such metric on Windows. Instead, there is a run queue length performance counter. However, it is expensive to obtain the run queue length performance counter. Since one requirement of this API has to be cheap, in Sun's implementation, it will return negative value on Windows until a fast implementation can be done in the future.

EVALUATION Will add this for Mustang. It's small RFE and low risk.