« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
XML

Blog::Navigation

GetJava Download Button
Get the Source
Personal Blog

Blog::Referers

Today's Page Hits: 59

Powered by Roller Weblogger.
« DTrace/Java: turning... | Main | JSR-223 script engin... »
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

Comments:

Post a Comment:

Comments are closed for this entry.
Copyright (C) 2005, A. Sundararajan's Weblog