Search code examples
javalinuxperformancecpujmx

How to get CPU value for particular application


I have two application running in my VM, One is JAVA application and another one is nodejs application.
I have configured JMX for my java application and I observe the CPU information being collected, Is it whole system specific (or) amount of CPU consumed by my application?

NOTE : I observe 80% CPU in JMX so if it is application specific, does it mean that it is consuming 80% of the total CPU and remaining 20 percent is given to other applications?


Solution

  • That depends what exactly you are looking at.

    The OperatingSystemMXBean allows you to query the system load. That means the overall CPU utilisation.

    To measure the resources used by your JVM, have a look here.