ANZJVM (Analyze Java Virtual Machine)

ANZJVM Command syntax diagram

 

Purpose

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 snaphot is done 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 device 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

 

Optional Parameters

JOB
Specifies the name of the job where the Java Virtual Machine (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.

A job identifier is a qualified name with up to three elements. For example:

job-name
user-name/job-name
job-number/user-name/job-name

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.

INTERVAL
Specifies the time interval in seconds between the snapshots of the JVM to be analyzed.

60: Sixty seconds will pass between the time data is collected.

number-of-seconds: The maximum number (0-3600) of seconds that will pass between JVM snapshots of data.

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
Specifies the order in which the information is sorted.

*NUMOBJCHG: Information is sorted by the number of objects changed.

*NUMOBJ: Information is sorted by 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.

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.

Example for ANZJVM

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 QJVACMDSRC, 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.

Error messages for 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 &2 in library &3.