A_JAVA_TRACE_VALUE

To track calls to the JVM made on behalf of the COBOL program, you can set one of the following three configuration variables: A_JAVA_TRACE_VALUE, A_JAVA_TRACE_FILENAME, and A_JAVA_GC_COUNT.

A_JAVA_TRACE_VALUE is a 32-bit value that determines the types of calls to trace. Add any of the following values together to create a single value to set.

1 - Show calls that return simple types (boolean, byte, character, short, integer, long, float, double).

2 - Show method calls that return simple types.

4 - Show string calls that return string references (that must be released).

8 - Show string calls that return simple types.

16 - Show calls that return references to a Java object (that must be released).

32 - Show method calls that return references to a Java object (that must be released).

64 - Show calls that return references to a Java array or array elements (that must be released).

128 - Show calls that return other array information.

256 - Show calls to the exception routines (some of which must be released).

512 - Show calls to get IDs (Method Identifiers or Field Identifiers).

1024 - Show calls to field functions that return references to a Java object (that must be released).

2048 - Show calls to field functions that return simple types.

4096 - Show other types of calls that return references to a Java object (that must be released).

8192 - Show calls to release a reference to a Java object.

16384 - Show other calls to the Java runtime.

Note for there to be no memory leaks, any call that returns a reference to a Java object (that must be released) needs to be paired with a call to release that reference. If the COBOL program gets that reference, it is responsible for releasing the reference. If the runtime gets the reference for internal purposes, the runtime is responsible for releasing the reference.

For example, setting A_JAVA_TRACE_VALUE to 13684 shows all calls to the JVM that obtain or release a reference to a Java object. Setting A_JAVA_TRACE_VALUE to -1 is equivalent to setting it to 32767 (which is the sum of all the above values), and has the added benefit of tracing new options that may be added in the future. However, for finding memory leaks, this may be too much information.