-XX:[+|-]HitachiLocalsInStackTrace (Option to output the local variable when the thread dump is output)
Format
- -XX:+HitachiLocalsInStackTrace
- This option outputs the local variable information to the stack trace when thread dump is output.
- -XX:-HitachiLocalsInStackTrace
- This option does not output the local variable information to the stack trace when thread dump is output.
Description
Examples of output
The following is an example of output using Java program example 2:
- When the -XX:+HitachiLocalsSimpleFormat option and the -XX:+HitachiTrueTypeInLocals option are specified:
"main" prio=1 tid=0xb6e88d20 nid=0xb7492080 runnable [bfffb000..bfffb474]
at Example2.method(Example2.java:15)
- locked <0xab040550> (a Example2)
locals:
(Example2) this = <0xab040550> (Example2)
(int) l1 = 1
(float) l2 = 2.000000
(java.lang.String) l3 = <0xaf112cc0> (java.lang.String)
(java.lang.Character) l4 = <0xab040698> (java.lang.Character)
(java.lang.Object) l5 = <0xab0407c8> (java.lang.Thread)
(java.lang.Object[]) l6 = <0xab0408b8> (java.lang.Thread[])
at Example2.main(Example2.java:4)
locals:
(java.lang.String[]) args [arg1] = <0xab040540> (java.lang.String[])
(Example2) e2 = <0xab040550> (Example2) |
Precautions
- To collect complete local variable information, while you are creating the class file in javac, you need to add the -g option or the -g:vars option and fill the local variable information in the class file. For the class file created without adding the -g option or the -g:vars option, the local variable information is output in the collectable range.
- The threads collecting the stack trace information and the threads that are to be collected, generally do not match. As a result, to collect the information, you need to terminate the target threads and you cannot invoke the toString method. Consequently, the specification of -XX:HitachiCallToString option becomes invalid.
- When the local variable information of the method containing complicated control structure and multiple lines is to be output, analysis takes time, and hence, it may take time to output the extended thread dump and to obtain the thread stack trace.