Request for Review: 7120511: Add diagnostic commands

Karen Kinnear karen.kinnear at oracle.com
Thu Jan 5 08:19:28 PST 2012


Frederic,

Code looks good.

A couple of minor comments/questions:
1) diagnosticCommand.cpp HeapDumpDCmd::execute
   - There is a comment in attachListener under dump_heap that would
      be helpful to have here as well: // Request a full GC before heap dump if live_objects ...

2) I wonder if it would be helpful for the  new jcmds that share functionality with existing mechanisms
    if it is worth a comment in the code noting where else this logic is called - might
    help future bug fixers do thorough testing.

3) attachListener jcmd
   You've added an out->cr() after throwing the exception here, but I wonder if
   you actually want it whether or not there was an exception thrown here -
   e.g. inside execute I see a number of places where there are print calls for
   exceptions and raw_print called - do those want the <cr> as well?
   Or are there cases where there is nothing printed so you would not want that? e.g. runFinalization?

thanks,
Karen

On Jan 5, 2012, at 10:19 AM, Frederic Parain wrote:

> This changeset aims to add a first set of diagnostic commands
> to the HotSpot JVM. It also includes minor modifications to
> the diagnostic command framework implementation to ease
> development of new diagnostic commands.
> 
> The webrev is here:
> 
> http://cr.openjdk.java.net/~fparain/7120511/webrev.00/
> 
> 
> Here's the list of new diagnostic commands:
> 
> Thread.print
>        Print all threads with stacktraces.
> 
> GC.class_histogram
>        Provides statistics about the Java heap usage
> 
> GC.heap_dump
>        Generate a HPROF format dump of the Java heap
> 
> GC.run_finalization
>        Call java.lang.System.runFinalization().
> 
> GC.run
>        Call java.lang.System.gc().
> 
> VM.uptime
>        Print VM uptime.
> 
> VM.flags
>        Print VM flag options and their current values.
> 
> VM.system_properties
>        Print system properties
> 
> VM.command_line
>        Print the command line used to start this VM instance.
> 
> 
> Thanks,
> 
> Fred
> 
> -- 
> Frederic Parain - Oracle
> Grenoble Engineering Center - France
> Phone: +33 4 76 18 81 17
> Email: Frederic.Parain at Oracle.com
> 



More information about the serviceability-dev mailing list