How do I monitor the computer's CPU, memory, and disk usage in Java?

后端 未结 11 2771
粉色の甜心
粉色の甜心 2020-11-22 13:02

I would like to monitor the following system information in Java:

  • Current CPU usage** (percent)
  • Available memory* (free/total)
  • Available d

11条回答
  •  不要未来只要你来
    2020-11-22 13:31

    A lot of this is already available via JMX. With Java 5, JMX is built-in and they include a JMX console viewer with the JDK.

    You can use JMX to monitor manually, or invoke JMX commands from Java if you need this information in your own run-time.

提交回复
热议问题