java 远程查看电脑磁盘,请问你如何在Java中监视计算机的CPU、内存和磁盘使用情况?...
在JDK1.7中,您可以通過com.sun.management.OperatingSystemMXBean..這與java.lang.management.OperatingSystemMXBean.
long? ? getCommittedVirtualMemorySize()
Returns the amount of virtual memory that is guaranteed to be available to the running process in bytes, or -1 if this operation is not supported.
long? ? getFreePhysicalMemorySize()
Returns the amount of free physical memory in bytes.
long? ? getFreeSwapSpaceSize()
Returns the amount of free swap space in bytes.
double? getProcessCpuLoad()
Returns the "recent cpu usage" for the Java Virtual Machine process.
long? ? getProcessCpuTime()
Returns the CPU time used by the process on which the Java virtual machine is running in nanoseconds.
double? getSystemCpuLoad()
Returns the "recent cpu usage" for the whole system.
long? ? getTotalPhysicalMemorySize()
Returns the total amount of physical memory in bytes.
long? ? getTotalSwapSpaceSize()
Returns the total amount of swap space in bytes.
總結
以上是生活随笔為你收集整理的java 远程查看电脑磁盘,请问你如何在Java中监视计算机的CPU、内存和磁盘使用情况?...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php如何缩小图片,PHP图片缩小函数一
- 下一篇: php memcached window