Enable Java attach API

If you are using a dynamically loaded JVMTI agent, the Java™ Attach API must be enabled in the application being sampled. The Java attach API is enabled by adding, the '-Dcom.ibm.tools.attach.enable=yes' run time parameter to the application being sampled. An example of how to enable the Java attach API in JCL that executes BPXBATCH is as follows:

//STEP EXEC PGM=BPXBATCH,
//PARM='sh java -Dcom.ibm.tools.attach.enable=yes'

Depending on the Java service release level you are running, the application being sampled may need to be run with UID=0 (the same UID as Application Performance Analyzer itself). See the chart below for the specific Java PTFs and service release levels that include the attach API, and for the associated job requirements for sampling.

Table 1. Java PTFs Including the Attach API
Java Version Service Release Java PTF Job Requirements
V6 31-bit SR6 UK50947 Add Dcom.ibm.tools.attach.enable=yes to the application being sampled. Run the application being sampled with UID=0.
V6 31-bit SR7 UK53084 Add Dcom.ibm.tools.attach.enable=yes’ to the application being sampled. Run the application being sampled with UID=0.
V6 31-bit SR8 and above UK56434 Add Dcom.ibm.tools.attach.enable=yes to the application being sampled.
V6 64-bit SR8 and above UK56435 Add Dcom.ibm.tools.attach.enable=yes to the application being sampled.

When measuring applications running with ‘-Dcom.ibm.tools.attach.enable=yes’ and without ‘UID=0’, J9VM might write some OPEN access violations in the system log. These can be ignored, because J9VM is attempting to open tmp directories that require UID=0 access. These directories have no significance to Application Performance Analyzer Analyzer and will not affect the measurement.