Is there good API to take the system resource all around , like linux / windows / Itanium / Solaris

Is there good API to take the system resource all around , like linux / windows / Itanium / Solaris.

I want to know the status of the resource all around the platforms.

used memory / cpu / top process like that.

Please recommend me the good API .
No matter commercial or not

Thanks in advance
gamjaradioAsked:
Who is Participating?
 
for_yanConnect With a Mentor Commented:
I don't think you can get top processes in system indepdnednt way
You can use Runtime.getRuntime().exec(...) and use specific commands for the system
0
 
for_yanConnect With a Mentor Commented:
This is about memory:

http://stackoverflow.com/questions/74674/how-to-do-i-check-cpu-and-memory-usage-in-java

  Runtime runtime = Runtime.getRuntime();

    NumberFormat format = NumberFormat.getInstance();

    StringBuilder sb = new StringBuilder();
    long maxMemory = runtime.maxMemory();
    long allocatedMemory = runtime.totalMemory();
    long freeMemory = runtime.freeMemory();

    sb.append("free memory: " + format.format(freeMemory / 1024) + "<br/>");
    sb.append("allocated memory: " + format.format(allocatedMemory / 1024) + "<br/>");
    sb.append("max memory: " + format.format(maxMemory / 1024) + "<br/>");
    sb.append("total free memory: " + format.format((freeMemory + (maxMemory - allocatedMemory)) / 1024) + "<br/>")

Open in new window

0
 
gamjaradioAuthor Commented:
actually I want know cpu percent per process.

like this

PID          used cpu percent
23122          20%
1920            30%
0
 
for_yanConnect With a Mentor Commented:
I don't think you can have fully system indpednent way to list top processes
these are some examples:
http://stackoverflow.com/questions/54686/how-to-get-a-list-of-current-open-windows-process-with-java
0
All Courses

From novice to tech pro — start learning today.