@alphatan
My research of this problem.
According to this answer of the question "Alternate of getSystemLoadAverage() for Windows?", the method getSystemLoadAverage of java.lang.management.OperatingSystemMXBean would return -1 in Windows.
It'd be suggested to use com.sun.management.OperatingSystemMXBean and its getSystemCpuLoad() and getProcessCpuLoad() instead.
@alphatan
My research of this problem.
According to this answer of the question "Alternate of getSystemLoadAverage() for Windows?", the method
getSystemLoadAverageof java.lang.management.OperatingSystemMXBean would return-1inWindows.It'd be suggested to use
com.sun.management.OperatingSystemMXBeanand itsgetSystemCpuLoad()andgetProcessCpuLoad()instead.