-
Notifications
You must be signed in to change notification settings - Fork 84
Home
JavaSysMon manages processes and reports useful system performance metrics cross-platform. You can think of it as a cross-platform version of the UNIX `top’ command, along with the ability to kill processes. It comes in the form of a single JAR file, which allows the native code to be hidden away so you never need to worry about it. See the JavaDoc for detailed information on the API.
Currently it reports:
- Process table (also available as a tree), including pid, ppid, name, command line, user, process size, resident process size, user time, and kernel time.
- Uptime
- Current process’s pid
- Total and free RAM
- Total and free swap
- CPU usage
- CPU frequency
- Number of CPUs
The library also provides support for killing processes, killing a process tree, and visiting processes.
If you want to add support for more metrics, the main goal is to be cross-platform. So unless someone wants to write some C to calculate load averages in Windows, for example, I won’t be putting load averages in (note that you can get load averages in Java 6 from OperatingSystemMXBean )
Here are the ones I would like to support in future:
- Network usage (bytes in / bytes out)
- Disk IO (bytes in / bytes out)
- Process environment variables
- Process start time
Supported platforms are Windows, Mac OS X, Linux, and Solaris. If you’re interested in adding support for a new platform, check out Adding support for a new platform. The more, the merrier.
The Java stuff is designed to work on Java 1.4 and higher (hence, sadly, no JUnit 4)
JavaSysMon is BSD licensed (to be precise: the FreeBSD 2-clause license).