-XX:[+|-]HitachiLocalsInThrowable (Option for collecting the local variable information when an exception occurs)

Format

-XX:+HitachiLocalsInThrowable
This option outputs the local variable information of the methods in the stack trace.
The -XX:+HitachiLocalsInThrowable option is ignored when java.lang.StackOverflowError occurs.
-XX:-HitachiLocalsInThrowable
This option does not output the local variable information of the methods in the stack trace.

Description

When the java.lang.Throwable.fillInStackTrace method is executed, the local variable information of the method in the stack trace is collected.

Default value
  • -XX:-HitachiLocalsInThrowable

Output format

 locals:
  name: <name>
  type: <type>
  value: <value>
...

The output contents are explained below:

Note that the output contents of each local variable are demarcated with a blank line.

name
Local variable name.
For the argument passed to the method, [arg***](*** is the argument number) will be displayed in continuation to the variable name.
type
Type name of the local variable (the basic type name, class name, or the array type name)
value
Character string representing the value of local variable
  • Basic type:
    Value converted as it is into a character string
  • Class or array type:
    When variable type is null: (null)
    Other than the above-mentioned: existing-address-of-the-object
Maximum length of the character string representing a value is 64. When the character string exceeds the maximum length, the characters up to 64th character are output and after that "..." character string is output. In the case of the class or array type, you can add detailed expressions by specifying the following add options:
  • -XX:+HitachiLocalsSimpleFormat
  • -XX:+HitachiTrueTypeInLocals
  • -XX:HitachiCallToString

Examples of output

The following is an example of output using Java program example 1:

When all the local variable information is output

at Example1.method(Example1.java:15)
 locals:
  name: this
  type: Example1
  value: <0x922f42d0>

  name: l1 [arg1]
  type: int
  value: 1

  name: l2 [arg2]
  type; char
  value: 'Q'

  name: l3 [arg3]
  type: java.lang.Object
  value: <0xaf112f08>

  name: l4
  type: float
  value: 4.000000

  name: l5
  type: boolean
  value: true

  name: l6
  type: double
  value: 1.79769E+308

  name: l7
  type: java.lang.Object[]
  value: <0x922f42d8>

at Example1.main(Example1.java:5)
 locals:
...

When the local variable information does not exist

Precautions