« March 2006 »
SunMonTueWedThuFriSat
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
19
20
21
22
23
24
27
28
29
30
      
Today
XML

Blog::Navigation

GetJava Download Button
Get the Source
Personal Blog

Blog::Referers

Today's Page Hits: 606

Powered by Roller Weblogger.
« Previous month (Feb 2006) | Main | Next month (Apr 2006) »
20060426 Wednesday April 26, 2006

Turning on/off and viewing JVM flags dynamically

As I mentioned in my last blog entry, jinfo tool may be used to turn (a subset of) JVM command line flags dynamically. As examples, I cited turning on/off verbose GC tracing and class loading tracing. jconsole may also be used to turn on verbose GC and verbose class modes.

jconsole to turn on/off verbose:class mode

You can use "Verbose Output" checkbox in "Classes" tab.

jconsole to turn on/off verbose:gc mode

This is little tricky! In "MBeans" tab, choose "java.lang"->"Memory" in tree and then you see "Verbose" attribute of Memory MBean. Here, you can change the value to false or true.

Using HotSpotDiagnosticMXBean with jconsole

HotSpotDiagnosticMXBean can be directly accessed and controlled from jconsole. In "MBeans" tab, choose com.sun.management->HotSpotDiagnoticMXBean in the tree and then choose "operations" menu in right panel. From this right panel, you can invoke getVMOption and setVMOption operations on HotSpotDiagnosticMXBean and thereby explicitly manage any manageable JVM flag. Also, this can be used to dump heap (dumpHeap operation - to which heap dump file name can be passed as an argument)

Viewing the value of any JVM -XX flag

jinfo can be used to view value of any JVM -XX flag (whether or not that flag is manageable - i.e., dynamically turnable or not).


    jinfo -flag <flag-name> <java-pid>

This is particularly useful if you use many of the -XX JVM flags.



( Apr 26 2006, 08:52:30 PM IST ) Permalink del.icio.us | furl | simpy | slashdot | technorati | digg

20060425 Tuesday April 25, 2006

DTrace/Java: turning on/off Java probes dynamically

In Mustang (Java SE 6), many DTrace probes have been added to hotspot JVM. Keith's blog has details on each of these probes.

Few probes such as method-entry, method-return (for Java method entry/exit), object-alloc (Java object alloc) etc. require the java application to be started with -XX:+ExtendedDTraceProbes flag. Starting from Mustang build 81, the application need not be started with this JVM flag. jinfo command line tool can be used to turn on/off JVM flags dynamically. In particular, jinfo may be used to turn on/off ExtendedDTraceProbes flag.

To turn on extended Java probes:


    jinfo -flag +ExtendedDTraceProbes <java-pid>

To turn off extended Java probes:

    jinfo -flag -ExtendedDTraceProbes <java-pid>

jinfo tools allows management of other JVM flags such PrintGC, TraceClassLoading etc. Please note that not all JVM flags may be managed dynamically. Only few subset of flags ("manageable flags") may be turned on/off dynamically. So, -verbose:gc, -verbose:class need not be used when starting the Java application. We can turn on/off GC, classloading tracing dynamically. Similar feature has been available from jconsole as well. Current value of any JVM flag may be printed using jinfo tool.

For example:


    jinfo -flag PrintGC <java-pid>

prints the value of PrintGC flag.



( Apr 25 2006, 07:00:41 PM IST ) Permalink Comments [1] del.icio.us | furl | simpy | slashdot | technorati | digg

20060418 Tuesday April 18, 2006

Dozen + 1 script engines (so far!)

Pnuts implementor Tomatsu has joined the http://scripting.dev.java.net project. He has checked in JSR 223 script engine for the Pnuts language. Enjoy!!



( Apr 18 2006, 07:38:59 AM IST ) Permalink del.icio.us | furl | simpy | slashdot | technorati | digg

20060417 Monday April 17, 2006

Dozen script engines for the Java platform

Mustang (Java SE 6) includes JSR-223 and reference JavaScript engine (based on Mozilla Rhino). That is one more aspect that shows that Java is not just Java the programming language - it is a platform that offers

While the Java programming language is great, developers need not always use the Java programming language to stay within the Java platform. Developers can use scripting and dynamically developed languages with the Java platform. Features to support for other languages (such as scripting, dynamically typed languages) have been added (and may be added in future as well)

We (Mike Grogan, the spec. lead of JSR-223 and I) have just started a java.net project (http://scripting.dev.java.net/) to develop and maintain JSR-223 script engines and scripting applications. So far, we have added script engines for the following languages (based on open source implementations of the scripting languages).

  1. Groovy
  2. Jelly
  3. Jexl
  4. JudoScript
  5. OGNL
  6. Python (Jython)
  7. Ruby (JRuby)
  8. Scheme
  9. Sleep
  10. Tcl (Jacl)
  11. XPath (XPath API wrapped as script engine)
  12. XSLT (XSLT API wrapped as script engine)
We welcome you to join/contribute/share and use this project!!



( Apr 17 2006, 03:44:10 PM IST ) Permalink del.icio.us | furl | simpy | slashdot | technorati | digg

Copyright (C) 2005, A. Sundararajan's Weblog