0

Hi for the past few days, I started working on JMX. Am not sure how to derive an mathematical formula to find 'the maximum amount of load that a processor can support' by computing various other factors using JMX (using Java program). Can anyone please suggest me how to derive an mathematical formula to find the maximum amount of load that a processor can support. Or is there any inbuilt function to find that.? Is it really possible to do the same using JMX or i need to shift to some other method?

skolima
  • 31,963
  • 27
  • 115
  • 151
shagul
  • 151
  • 1
  • 3
  • 11
  • How do you define load? The unix-style definition, based on process queues? – MRalwasser Feb 09 '12 at 09:44
  • Am looking for a java program to find the load of the running system – shagul Feb 09 '12 at 09:47
  • possible duplicate of [How to monitor the computer's cpu, memory, and disk usage in Java?](http://stackoverflow.com/questions/47177/how-to-monitor-the-computers-cpu-memory-and-disk-usage-in-java) – Frankie Feb 09 '12 at 09:51
  • No i already saw that post. That is slightly similar. but I didn't found what am exactly searching for. – shagul Feb 09 '12 at 09:53
  • You want a mathematical formula about the `the maximum amount of load that a processor can support` without exactly defining what `load` is? And what does "support" mean there? – Voo Feb 09 '12 at 10:01
  • it mean that the maximum amount of load that a processor can bear. That is the processor can execute all the incoming the request successfully, without going into system crash. – shagul Feb 09 '12 at 10:08

1 Answers1

3

You can Use javamelody to find out Memory usage, CPU usage, and Http session Usage like Below:

enter image description here
or you can use SIGAR, it provides a portable interface for gathering system information.
Edit: For your scenario you can use Class ManagementFactory.

The platform MBean server was introduced in the Java 2 Platform, Standard Edition 5.0, and is an MBean server that is built into the Java Virtual Machine (Java VM). The platform MBean server can be shared by all managed components that are running in the Java VM. You access the platform MBean server using the java.lang.management.ManagementFactory method getPlatformMBeanServer.

Documentaion: management_mxbeans

Chandra Sekhar
  • 16,256
  • 10
  • 67
  • 90
  • Is javamelody or SIGAR can be used inside the java program to do decision making..? Because i want to find the cpu load inside the java program so that i can make decision making with those results.. – shagul Feb 09 '12 at 10:05
  • added Update to use ManagementFactory. – Chandra Sekhar Feb 09 '12 at 10:46
  • sorry as am new to this ManagementFactory, i dont know how to use it in my program. Can you please suggest some tutorials with sample code on how to use 'Class ManagementFactory'... – shagul Feb 09 '12 at 10:50
  • see the [documentation](http://docs.oracle.com/javase/6/docs/technotes/guides/management/mxbeans.html). – Chandra Sekhar Feb 09 '12 at 11:34