Commands for use with jdmpview

jdmpview -Xgcpolicy:metronome is an interactive, command-line tool to explore the information from a JVM system dump and perform various analysis functions.

cd <directory_name>
Changes the working directory to <directory_name>. The working directory is used for log files. Logging is controlled by the set logging command. Use the pwd command to query the current working directory.
deadlock
This command detects deadlock situations in the Java™ application that was running when the system dump was produced. Example output:
deadlock loop:
thread: Thread-2 (monitor object: 0x9e32c8) waiting for =>
thread: Thread-3 (monitor object: 0x9e3300) waiting for =>
thread: Thread-2 (monitor object: 0x9e32c8)
Threads are identified by their Java thread name, whereas object monitors are identified by the address of the object in the Java heap. You can obtain further information about the threads using the info thread * command. You can obtain further information about the monitors using the x/J <0xaddr> command.

In this example, the deadlock analysis shows that Thread-2 is waiting for a lock held by Thread-3, which is in turn waiting for a lock held earlier by Thread-2.

find <pattern>,<start_address>,<end_address>,<memory_boundary>,<bytes_to_print>,<matches_to_display>

This command searches for <pattern> in the memory segment from <start_address> to <end_address> (both inclusive), and shows the number of matching addresses you specify with <matches_to_display>. You can also display the next <bytes_to_print> bytes for the last match.

By default, the find command searches for the pattern at every byte in the range. If you know the pattern is aligned to a particular byte boundary, you can specify <memory_boundary> to search every <memory_boundary> bytes. For example, if you specify a <memory_boundary> of "4", the command searches for the pattern every 4 bytes.

findnext
Finds the next instance of the last string passed to find or findptr. It repeats the previous find or findptr command, depending on which one was issued last, starting from the last match.
findptr <pattern>,<start_address>,<end_address>,<memory_boundary>,<bytes_to_print>,<matches_to_display>
Searches memory for the given pointer. findptr searches for <pattern> as a pointer in the memory segment from <start_address> to <end_address> (both inclusive), and shows the number of matching addresses you specify with <matches_to_display>. You can also display the next <bytes_to_print> bytes for the last match.

By default, the findptr command searches for the pattern at every byte in the range. If you know the pattern is aligned to a particular byte boundary, you can specify <memory_boundary> to search every <memory_boundary> bytes. For example, if you specify a <memory_boundary> of "4", the command searches for the pattern every 4 bytes.

help [<command_name>]
Shows information for a specific command. If you supply no parameters, help shows the complete list of supported commands.
info thread [*|<thread_name>]
Displays information about Java and native threads. The following information is displayed for all threads ("*"), or the specified thread:
  • Thread id
  • Registers
  • Stack sections
  • Thread frames: procedure name and base pointer
  • Associated Java thread, if applicable:
    • Name of Java thread
    • Address of associated java.lang.Thread object
    • State according to JVMTI specification
    • State relative to java.lang.Thread.State
    • The monitor the thread is waiting to enter or waiting on notify
    • Thread frames: base pointer, method, and filename:line
If you supply no parameters, the command shows information about the current thread.
info system
Displays the following information about the system that produced the core dump:
  • amount of memory
  • operating system
  • virtual machine or virtual machines present
info class [<class_name>]
Displays the inheritance chain and other data for a given class. If a class name is passed to info class, the following information is shown about that class:
  • name
  • ID
  • superclass ID
  • class loader ID
  • modifiers
  • number of instances and total size of instances
  • inheritance chain
  • fields with modifiers (and values for static fields)
  • methods with modifiers
If no parameters are passed to info class, the following information is shown:
  • the number of instances of each class.
  • the total size of all instances of each class.
  • the total number of instances of all classes.
  • the total size of all objects.
info proc
Displays threads, command-line arguments, environment variables, and shared modules of the current process.
Note: To view the shared modules used by a process, use the info sym command.
info jitm
Displays JIT and AOT compiled methods and their addresses:
  • Method name and signature
  • Method start address
  • Method end address
info lock
Displays a list of available monitors and locked objects
info sym
Displays a list of available modules. For each process in the address spaces, this command shows a list of module sections for each module, their start and end addresses, names, and sizes.
info mmap
Displays a list of all memory segments in the address space: Start address and size.
info heap [*|<heap_name>]
If no parameters are passed to this command, the heap names and heap sections are shown.
Using either "*" or a heap name shows the following information about all heaps or the specified heap:
  • heap name
  • (heap size and occupancy)
  • heap sections
    • section name
    • section size
    • whether the section is shared
    • whether the section is executable
    • whether the section is read only
hexdump <hex_address> <bytes_to_print>
Displays a section of memory in a hexdump-like format. Displays <bytes_to_print> bytes of memory contents starting from <hex_address>.
+
Displays the next section of memory in hexdump-like format. This command is used with the hexdump command to enable easy scrolling forwards through memory. The previous hexdump command is repeated, starting from the end of the previous one.
-
Displays the previous section of memory in hexdump-like format. This command is used with the hexdump command to enable easy scrolling backwards through memory. The previous hexdump command is repeated, starting from a position before the previous one.
pwd
Displays the current working directory, which is the directory where log files are stored.
quit
Exits the core file viewing tool; any log files that are currently open are closed before exit.
set logging <options>
Configures logging settings, starts logging, or stops logging. This parameter enables the results of commands to be logged to a file.

The options are:

[on|off]
Turns logging on or off. (Default: off)
file <filename>
sets the file to log to. The path is relative to the directory returned by the pwd command, unless an absolute path is specified. If the file is set while logging is on, the change takes effect the next time logging is started. Not set by default.
overwrite [on|off]
Turns overwriting of the specified log file on or off. When overwrite is off, log messages are appended to the log file. When overwrite is on, the log file is overwritten after the set logging command. (Default: off)
redirect [on|off]
Turns redirecting to file on or off, with off being the default. When logging is set to on:
  • a value of on for redirect sends non-error output only to the log file.
  • a value of off for redirect sends non-error output to the console and log file.
Redirect must be turned off before logging can be turned off. (Default: off)
show logging
Displays the current logging settings:
  • set_logging = [on|off]
  • set_logging_file =
  • set_logging_overwrite = [on|off]
  • set_logging_redirect = [on|off]
  • current_logging_file =
  • The file that is currently being logged to might be different from set_logging_file, if that value was changed after logging was started.
whatis <hex_address>
Displays information about what is stored at the given memory address, <hex_address>. This command examines the memory location at <hex_address> and tries to find out more information about this address. For example, whether it is in an object in a heap or in the byte codes associated with a class method.
x/ (examine)
Passes number of items to display and unit size ('b' for byte (8 bit), 'h' for half word (16 bit), 'w' for word (32 bit), 'g' for giant word (64 bit)) to sub-command (for example x/12bd). This is like the use of the x/ command in gdb (including use of defaults).
x/J [<0xaddr>|<class_name>]
Displays information about a particular object, or all objects of a class. If <class_name> is supplied, all static fields with their values are shown, followed by all objects of that class with their fields and values. If an object address (in hex) is supplied, static fields for that object's class are not shown; the other fields and values of that object are printed along with its address.
Note: This command ignores the number of items and unit size passed to it by the x/ command.
x/D <0xaddr>
Displays the integer at the specified address, adjusted for the hardware architecture this dump file is from. For example, the file might be from a big endian architecture.
Note: This command uses the number of items and unit size passed to it by the x/ command.
x/X <0xaddr>
Displays the hex value of the bytes at the specified address, adjusted for the hardware architecture this dump file is from. For example, the file might be from a big endian architecture.
Note: This command uses the number of items and unit size passed to it by the x/ command.
x/K <0xaddr>
Where the size is defined by the pointer size of the architecture, this parameter shows the value of each section of memory. The output is adjusted for the hardware architecture this dump file is from, starting at the specified address. It also displays a module with a module section and an offset from the start of that module section in memory if the pointer points to that module section. If no symbol is found, it displays a "*" and an offset from the current address if the pointer points to an address in 4KB (4096 bytes) of the current address. Although this command can work on an arbitrary section of memory, it is probably more useful on a section of memory that refers to a stack frame. To find the memory section of a thread stack frame, use the info thread command.
Note: This command uses the number of items and unit size passed to it by the x/ command.


© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)