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.
You can use "Verbose Output" checkbox in "Classes" tab.
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.
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)
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.
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.
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!!
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).