Analyze Java Virtual Machine (ANZJVM)
The Analyze Java Virtual Machine (ANZJVM) command collects information about the Java Virtual Machine (JVM) for a specified job. A set of JVM information is collected immediately when the command is run. This collected JVM data is called a snapshot. A second snapshot is taken a specified amount of time later. By taking a snapshot of the JVM and comparing the data with a snapshot taken at a later time, the data can be analyzed to help find object leaks. The information is dumped using printer file QSYSPRT. The user data for the QSYSPRT file is 'ANZJVM'. The dump includes formatted information about the JVM heap. Details include names of classes, number of active objects per class, and the class loader used to load each class.
Restrictions:
- This command uses the Start Service Job (STRSRVJOB) and Start Debug (STRDBG) commands. The user of this command must be authorized to those commands.
- This command is shipped with public *EXCLUDE authority and the QPGMR, QSYSOPR, QSRV, and QSRVBAS user profiles have private authorities to use the command.
- This command must be run under a user profile that is the same as the job user identity of the JVM job, or that has use (*USE) authority to the job user identity of the JVM job.
- This command is not allowed if the remote service operation has been started for another job and that job is not the same job specified on this command.
- This command is not allowed if the JVM job is held, suspended, or ending.
Keyword |
Description |
Choices |
Notes |
JOB |
Job name |
Qualified job name |
Optional, Positional 1 |
Qualifier 1: Job name |
Name |
Qualifier 2: User |
Name |
Qualifier 3: Number |
000000-999999 |
INTERVAL |
Time interval |
0-3600, 60 |
Optional |
FRCGC |
Force garbage collection |
*YES, *NO |
Optional |
SORT |
Sort by |
*NUMOBJCHG, *NUMOBJ, *SIZECHG, *SIZE, *NAME |
Optional |
DUPJOBOPT |
Duplicate job option |
*SELECT, *MSG |
Optional |
Job name (JOB)
Specifies the name of the job where the JVM is running. If no job number is given, all of the jobs currently in the system are searched for the simple job name. The job name entered must be a job in which a JVM is currently running.
- *SRVJOB
- Information about the JVM in the job currently being serviced will be dumped. If no job is currently being serviced, then a job identifier is required.
- job-name
- Specify the name of the JVM job.
- user-name
- Specify the name of the user of the JVM job.
- job-number
- Specify the number of the JVM job.
Time interval (INTERVAL)
Specifies the time interval in seconds between the snapshots of the JVM to be analyzed.
- 60
- Sixty seconds will pass between JVM snapshots of data.
- 0-3600
- Specify the maximum number of seconds that will pass between JVM snapshots of data.
Force garbage collection (FRCGC)
Specifies if a garbage collection cycle should be forced to take place.
- *YES
- A garbage collection cycle will take place before each snapshot of data is collected.
- *NO
- No garbage collection cycle will be forced to take place while collecting the data.
Sort by (SORT)
Specifies the order in which the information is sorted.
- *NUMOBJCHG
- Information is sorted by the number of objects changed.
- *NUMOBJ
- Information is sorted by the number of objects in the first snapshot.
- *SIZECHG
- Information is sorted by the change in the amount of space used by the object.
- *SIZE
- Information is sorted by the amount of space used by the object.
- *NAME
- Information is sorted by the class name.
Duplicate job option (DUPJOBOPT)
Specifies the action taken when duplicate jobs are found by this command.
- *SELECT
- The selection display is shown when duplicate jobs are found during an interactive session. Otherwise, an escape message is issued.
- *MSG
- An escape message is issued when duplicate jobs are found.
ANZJVM JOB(099246/FRED/QJVACMDSRV) INTERVAL(60)
This command will collect two snapshots of the Java Virtual Machine (JVM), 60 seconds apart, for the job with job name QJVACMDSRV, user name FRED, and job number 099246. The analyzed data from the snapshots is written to a spooled file. The spooled file name will be QSYSPRT and the spooled file user data text will be ANZJVM.
*ESCAPE Messages
- JVAB602
- Job parameter required.
- JVAB603
- Unable to open print file.
- JVAB605
- ANZJVM failed with reason code &1.
- JVAB60A
- Job not found.
- CPF1938
- Command is not allowed while serviced job is not active.
- CPF3524
- More than one job with specified name found.
- CPF3536
- Job completed and cannot be serviced.
- CPF3938
- Already servicing another job.
- CPF9824
- Not authorized to command &1 in library &2.