You might look into the tasklist command since it will write to standard output that you can capture and interpret in your java program. Try tasklist /? for online details. Let us know if you come up with something cool. Bill
All the taskmgr does is pull from the system counters. With Windows XP pro, these same counters are also available with the typeperf command. This command prints to stdout, so you can parse the result from Java.
typeperf "\processor(_Total)\% Processor Time"
This will give you the total processor ultilization in terms of percentage.
pslist will also be useful for one to see which thread is taking more time(OR doing tight loops in a JVM).
If you JDK 1.5 onwards, pure java code without resorting to Runtime.exec ( which is costly) using JMX package java.lang.management. The JMX-bean/classes you are interested are: * ThreadInfo * ThreadMBean [ March 24, 2006: Message edited by: Mahadevan Gorti SS ]
typeperf seems to be a conglameration of unix commands that simply uses differing parameters rather than differing commands to get the info. What you seem to be getting from this is the same information that you can get from a grouping of the commands ps, sar, psradm and a few others on unix systems.