• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Memory/CPU/timing resources from Java Program

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to add some diagnostics details in a Java program.

What details are available from the Runtime environment, as well as the Java class. The goal is to have as much details about the context of the process when an exception occurs.

My understanding is that Memory/CPU usage is not available.

Is there a way to get number of threads running? Other details to diagnoze the issue.

Please share your experience,
- Avi
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're using JDK 5 look at JConsole. It's a freebie with the JDK that can examine another running Java program. I put the following options on my Wiki program so I can connect JConsole to it:

JConsole is pretty cool as it is, and it is using documented APIs so you do some of the same things yourself.
 
Avianu Sud
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is helpful. Thanks. Additionally what I am also trying to do is record as much additional state information when an exception occurs.
What else can be accessable at Runtime?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is another free profiler which might be useful to trace objects usage and method timings.
http://java-source.net/open-source/profilers/jmp
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic