• Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieve other JVMs properties  RSS feed

 
mike nu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a web application for monitoring use, and I have some other JVM nodes. There are some settings passed to the JVM node, like java -Dmyprop=someValue. In my web application, I need to retrieve these properties. Is this possible to do it? If yes, how should I do it?

Thanks,

Mike
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See JConsole with Java 5 or later. The APIs it uses are available for you to use, too. Here's how I start my JVM to enable a remote console:

Here are the JVM topics JConsole displays:

VM Information
Java Virtual Machine:
Vendor:
Uptime:
Name:
VM arguments:
Class path:
Library path:
Boot class path:
Compiler
JIT compiler:
Total compile time:
Operating System
Operating System:
Architecture:
Number of processors:
Process CPU time:
Total physical memory:
Free physical memory:
Committed virtual memory:
Total swap space:
Free swap space:
[ March 21, 2006: Message edited by: Stan James ]
 
mike nu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stan,

Thank you very much for your suggestions. Is it possible to do it using JDK 1.4?

Thanks,
Mike
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your server is JMX compatible, then you can use JMX to monitor your JVM.


http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!