• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Retrieve other JVMs properties

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic