gcj & JMX
Andrew John Hughes
a.hughes@dcs.shef.ac.uk
Tue Feb 13 11:58:00 GMT 2007
On 13 Feb 2007, at 07:42, Patrick Olinet wrote:
> Hi folks,
>> I'd like to know if there is a gcj equivalent to the Sun's monitoring
> & management JMX extension. The java.lang.management.* classes seem to
> exist in my libgcj.jar file, but I have no idea of their status and
> whether they can be used by the mx4j package that provides the JMX
> support on my system. If they can, how are they supposed to work ?
>> My point is to be able to monitor the memory usage of my application,
> as it's possible to do with Sun's jconsole tool when you set the
> 'com.sun.management.jmx.remote' system property at application
> startup.
>> Any thoughts ?
>> Thanks in advance for your replies.
>> Patrick
Hi Patrick,
I've been working on the JMX classes (which are now part of 1.5 and
1.6) since about last June.
This initially involved the java.lang.management classes (and their
implementation, to an extent,
for gcj) and has now moved on to include the javax.management stuff
(which mx4j also provides).
The status of your copy of libgcj depends on a variety of factors,
including which version of gcc
you're using, with which distribution and how recently that was
synchronised with the main Classpath
repository. There should be others on this list more suitable to
comment on the specifics here.
The current status is that the interfaces for java.lang.management
are fully implemented to 1.6.
These are implemented to varying degrees in the various packages that
use Classpath as an
upstream (gcj included). I'd need to go back to my code for gcj to
ascertain what stage the implementation
is for this, but memory usage monitoring shouldn't be too difficult
to add if it's not already present.
As to remote monitoring, this relies more on the JMX implementation.
Assuming mx4j has the remote
stuff implemented, it should be possible to monitor the
lang.management beans using it (the beans themselves
are just ordinary JMX beans), but there may be some bits and bobs
missing to make this like Sun's implementation.
Certainly, recent versions of the code provide the beans registered
in the platform bean server, accessible
via ManagementFactory.getPlatformMBeanServer().
Hope this helps,
Let me know if there's anything more I can tell you about this,
Cheers,
--
Andrew :)
More information about the Java
mailing list