7 Replies Latest reply on Feb 16, 2006 12:28 PM by starksm64

    How to explore CPU via JMX

    aditya

      Hi,
      I have a query related to JMX capabilities to monitor the memory usage of CPU for a particular process.
      My requirement is to monitor the CPU memory usage via JMX is this posiible ?? I don't know how this can be achieved using JMX.
      Also can I start or stop the NT services using JMX technology?
      Looking forward for your help....
      Thanks in advance
      Aditya

        • 1. Re: How to explore CPU via JMX

          Since what you require is really system specific, it would have to been done via native method calls (meaning having to write C++ or some other native language). You could then take this native code and access it via Java (JNI) and wrap it in an MBean. To my knowledge, this is the only way to go.

          Since this is a fairly common requirement, so you might find a project on SourceForge that already provides the code you need. If you find something like this, please post it badk to the forum for others.

          • 2. Re: How to explore CPU via JMX
            peter_f
            • 3. Re: How to explore CPU via JMX

              This might be included in java 1.5
              There are plans to monitor the jvm using jmx.

              Regards,
              Adrian

              • 4. Re: How to explore CPU via JMX
                heejune

                Hi,

                I think I first have to remind you that
                JMX is just a standard for any management client applicaiton that follows this API can find and get/set/invoke an MBean (agent or the target object itself). So, if you can do anything in JAVA or even JNI,
                then you can do it using JMX.
                Whether you can do or not is totally dependent on if you can do the job when JMX is not involved.

                Specifically, you can get free JVM memory through Runtime.getmemeory and you can shutdown using some system dependent JNI code.

                BR

                • 5. Re: How to explore CPU via JMX
                  jhaynie

                  we've developed a runtime stats mbean that will allow you to explore/send notifications about:

                  - CPU load
                  - RAM in usage
                  - Handle count
                  - Free/Available Disk Space

                  Requires JNI to get the values, and works on Windows and Linux currently.

                  I'd like to open source it and get it into JBoss distro soon... when i have some more time.

                  • 6. Re: How to explore CPU via JMX
                    cassiofreire

                    Hi All,

                    Somebody has another solution for this question?

                    Thanks in advance

                    • 7. Re: How to explore CPU via JMX
                      starksm64

                      java.lang.management.ThreadMXBean in jdk5