Menu

Tree [r1] /
 History

HTTPS access


File Date Author Commit
 JSysMonitor 2009-01-05 mariusmik [r1] the very first release
 README 2009-01-05 mariusmik [r1] the very first release

Read Me

JSysMonitor library for monitoring system resources in Java.
Copyright (c) 2009 Marius Mikucionis <mmikucionis@gmail.com>
Licensed under conditions of GPL version 2.0.

License
=======

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


About
=====
System monitor is a Java library for monitoring system resources like 
memory and CPU consumption. The library provides unified cross-platform 
API for accessing system information. 
Currently Linux and Windows are supported via Java Native Interface (JNI).

Problem
=======
Java provides very limited interaction with other system processes, which 
makes it very difficult to implement benchmarking and system monitoring 
utilities. This little project attempts to provide a simple Java API to 
monitor all system processes with a help of JNI (Java Native Interface).

In this Project
===============
We provide:
 * sysmon.jar sample implementation for system and process monitoring in 
     Java (all sources included). Currently only Linux and Windows support 
     is implemented. JNI aspect is totally hidden, you just need this one 
     little jar library and you can run it right away.
 * javadoc of sysmon.jar classes.
 * cpumemhog for Linux and for Windows: CPU and memory hungry program to 
     try on, alternatively you may want to try on Uppaal verifyta process 
     instead.

Building
========
There is Makefile in the JSysMonitor directory that you can use to build 
several targets, so just type "make $target" where the $target is one of 
the following:
linux
	will compile and run example monitor for Linux.
win32
	will compile and run example monitor for Windows.
sysmon.jar
	will compile all the binaries into sysmon.jar library.

Makefile assumes that Sun Java Development Kit 6 (JDK6) is installed at
"/usr/lib/jvm/java-6-sun" (Linux) or "c:/Program Files/Java/jdk1.6.0_01"
(Windows). Feel free to adjust the paths in the Makefile if it's not the 
case on your system.

When building on Windows, use MinGW environment (GNU Lesser license), 
or Cygwin with GCC from MinGW. Note that if built by GCC from Cygwin, 
running sysmon.jar will require cygwin1.dll library installed on the system 
(I have not tried it, but such requirement asks for additional maintenance).

Known Limitations
===================
 * There is no package declaration. The directory is a mixture of Java and 
     C++ files, there are non-trivial dependencies between them, therefore 
     moving files across different directories requires the build system 
     to be redesigned...
     I simply don't have the time for this now, perhaps in the future 
     if/when this library gains some popularity.
 * sysmon.jar API uses integer PIDs (process identifiers). This is not very 
     portable, but can be easily changed if needed.
 * If process is created via Runtime.exec() method, then there is no sure 
     way of getting PID for that process. One must guess by name, 
     creation date or use some other heuristic means to discover PID 
     (e.g. communicate to that process via standard I/O).

Have fun!
Marius Mikucionis
<mmikucionis@gmail.com>