IBM Support

Using WRKJVMJOB to Dump JVM Data on the IBM i OS

Troubleshooting


Problem

This document describes how the WRKJVMJOB command can be used to generate system, Java™, heap, and GCcycle dumps on the IBM i OS. It also shows how to collect JVM summary information.

Environment

IBM i OS

Resolving The Problem

WRKJVMJOB overview

The WRKJVMJOB command is only applicable to IBM Technology for Java VMs running on IBM i 6.1 and later. It allows the user to monitor Java virtual machines (JVMs) running in active jobs. The following information and functions are available through WRKJVMJOB.

o The arguments and options with which the JVM was started.
o Environment variables for both ILE and PASE.
o Java lock requests outstanding for the JVM job.
o Garbage collection information.
o The properties with which the JVM was started.
o The properties with which the JVM is currently running.
o The list of threads associated with the JVM.
o The partially completed job log for the JVM job.
o The ability to work with spooled input and output files for the JVM job.
o The ability to generate JVM (System, Heap,
Java™) dumps from a panel option.
o The ability to enable and disable verbose garbage collection from a panel option.
The WRKJVMJOB Command

This video shows how to use the WRKJVMJOB command. It includes instructions to generate a Java™ thread dump (javacore).

System, Java™, and Heap dumps

1. On the operating system command line, type in the following:
WRKJVMJOB
Press the Enter key.

2. Locate the JVM you want to perform a dump on and enter 5 to Work with the JVM.
Press the Enter key.

3. Select the dump you want to perform. The output location of each dump will be logged in the joblog of the JVM.
Following are three examples:

a) Heap dump
Select Option 30, Generate heap dump, and press the Enter key.
Example messages returned: "JVMDUMP007I JVM Requesting Heap Dump using '.../heapdump.xxx.xxx.xxx.xxx.phd'"
"JVMDUMP010I Heap Dump written to '.../heapdump.xxx.xxx.xxx.xxx.phd'"

b) System dump
Select Option 31, Generate system dump, and press the Enter key.
Example messages returned: "JVMDUMP007I JVM Requesting System Dump using '.../core.xxx.xxx.xxx.xxx.dmp'"
"JVMDUMP010I System Dump written to '.../core.xxx.xxx.xxx.xxx.dmp'"

Note: You must run jextract against the System dump on the server it was gathered on. A compressed file is produced from the jextract utility and will need to be sent into IBM, along with the other Java and GcCycles dumps.
Refer to the following technical document for instructions on how to run the jextract utility.
Document Title: IBM Technology for Java - jextract (https://www.ibm.com/support/pages/node/687001)

c) Java dump
Select Option 32, Generate Java™ dump, and press the Enter key.
Example messages returned: "JVMDUMP007I JVM Requesting Java Dump using '.../javacore.xxx.xxx.xxx.xxx.txt'"
"JVMDUMP010I Java Dump written to '.../javacore.xxx.xxx.xxx.xxx.txt'"

GcCycle dump

1. On the operation system command line, type in the following:
WRKJVMJOB
Press the Enter key.

2. Locate the JVM you want to perform a dump on and enter 9 to Display GC information.
Press the Enter key.

3. Press F7 to Print the GC tables. You will receive a message stating, Print request completed successfully.

4. A spooled file named QPJVAWRKVM will be created in the user's output queue.
 

JVM Summary Information

Collect PRTJVMJOB by performing the following:

  • Execute the WRKJVMJOB command
  • Type 13 on the target job, and press Enter to print (a spooled file is generated)
     

How to collect and send diagnostic information to IBM Support

1. Collect all spooled files

You can see all the spooled files you generated by:

  • Execute the WRKJOB command
  • Type 4 to work with spooled files

You will see QPJVAWRKVM files

Directions for collecting spooled files that you own

To retrieve the spooled files that you own, do the following:

1. Open the System i Navigator.
2. Expand your system where the files are located. Log in with your user ID (preferably QSECOFR or equivalent).
3. Expand Basic Operations, and then left click on Printer Output to display the output files.
4. Locate the following spooled files: Refer to the list above.
5. Finally, right-click the files from System i Navigator, select Export..., select the destination folder, and click Save.

Directions for collecting spooled files under a different user than yourself

To retrieve the spooled files that another user owns, do the following:
1. Open the System i Navigator.
2. Expand your system where the files are located. Log in with your user ID (preferably QSECOFR or equivalent).
3. Expand Basic Operations, and then right click on Printer Output, and select Customize this View.
4. Under the General tab, click Browse, from the list of users, and select the user who owns the spooled file.
5. Locate the following spooled files: Refer to the list above.
6. Finally, right-click the files from System i Navigator, select Export..., select the destination folder, and click Save.

 

2. Collect the dump files from the IFS of the System i

Directions for collecting files located in the IFS

To retrieve the file(s), do the following:

1. Open the System i Navigator.
2. Expand your system where the files are located. Log in with your user ID (preferably QSECOFR or equivalent).
3. Expand File Systems, and drill down to the directory that contains the files requested by this document.
4. Locate the following files:
The Java™, system, or heap dump files can be found by checking the joblog of the JVM.
WRKJOB JOB(NUMBER/USER/NAME), Option 10 to Display job log

Java dump:

Example messages returned: "JVMDUMP007I JVM Requesting Java Dump using '.../javacore.xxx.xxx.xxx.xxx.txt'"

"JVMDUMP010I Java Dump written to '.../javacore.xxx.xxx.xxx.xxx.txt'"

Reminder: If you are sending in a System Dump you should be looking for the .zip file that is created by the jextract utility (see System, Java™, and Heap dumps section above).

5. Finally, drag the files from System i Navigator to your desktop.

 

3. Upload the data to IBM Support

Refer to the MustGather: Instructions for Sending Data to IBM i Support document for detailed information on uploading data to IBM.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CH5AAM","label":"Java Development Kit"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

548018334

Document Information

Modified date:
27 January 2022

UID

nas8N1012559