This document provides step-by-step instructions for enabling IBM Java "DirectByteBuffer" related logging options. It also explains how to gather, package, and upload the data to IBM support.
Jump to section: (Background) (Setup) (Run) (Format) (Package) (Upload)
The instructions in this document make references to generic terms in Italics that will need to be replaced with information specific to the support call and the environment. It is very important that consistent and accurate values be used in place of the Italicized generic terms when collecting the data to ensure the prompt and correct delivery of the data when uploaded.

Generic Term

Replace with

JAVA_PATH

The parent Java installation directory (e.g. /usr/java6 or /usr/java7_64).

PID

The process id of the active Java process (e.g. use "ps" command to check the PID column to identify the process).

Overview
Step-by-Step Instructions

Step 1:

Background

Direct byte buffers(DBB) are allocated in native memory bypassing the Java heap. They provide the best possible performance for dealing with byte sequences by allocating memory directly on the native heap.

To trace the allocation and deallocation of direct byte buffers, use the -Xtrace option

From Java 6 SR11 onwards, trace points have been added to help diagnose memory problems associated with the use of direct byte buffers. The trace point IDs are j9jcl.335 to j9jcl.338, and have the following form:

- Trace point j9jcl.335 prints the amount of memory being allocated:
- Trace point j9jcl.336 prints when memory cannot be allocated:
- Trace point j9jcl.337 prints the address of the allocated memory:
- Trace point j9jcl.338 prints the address of the memory being freed:

Step 2:

Setup

To journal all of the trace points above and stack trace information to the file, dbbtrace.trc, add the following, in double quotes, to your java command line

"-Xtrace:none,output={dbbtrace%p_#.trc,100m,5},maximal=j9jcl.335-338,trigger=tpnid{j9jcl.335-338,jstacktrace}"

For example:

java "-Xtrace:none,output={dbbtrace%p_#.trc,100m,5},maximal=j9jcl.335-338,trigger=tpnid{j9jcl.335-338,jstacktrace}" HelloWorld

produces the trace file below:

ls *.trc
dbbtrace2621880_0.trc

Step 3:

Run

Monitor the process size until it grows sufficiently large. You can use the top -p PID command to monitor the virtual and physical memory usage.

top -p PID -d delay-time -n iterations

where PID is the process id, delay-time is the time between writes, and iterations is the number of writes

For instance, to monitor a java process id, 10303, every ten minutes (600 seconds) for a two days (2*24*6=288) enter:

top -p 10303 -d 600 -n 288 -b >> process_size.log

Once the process size grows to three times the application's Xmx (max java heap) value, gracefully exit the application.

Step 4:

Format

In order to create a readable trace file, format it with TraceFormat. The log file, dbbtrace<PID>#.trc can be formatted with the command::

JAVA_PATH/bin/java com.ibm.jvm.TraceFormat dbbtrace<PID>_#.trc dbbtrace<PID>_#.trc.txt

to produce a readable text file.

Step 5:

Package


Package the dbbtracePID_#.trc.txt and process_size.log so it can be uploaded to IBM support

tar -cf - dbbtracePID_#.trc.txtprocess_size.log | gzip -c >PMR.MM-DD-YY.tgz

where PMR is the pmr number (ex. 44722,333,000)
and MM-DD-YY is the month, day, and year

Step 6:

Upload

Upload the packaged data or individual files to an IBM secured server using one of upload options provided on the "MustGather: How to upload diagnostic data and testcases to IBM" web page:

http://www-01.ibm.com/support/docview.wss?uid=isg3T1022619

Step 7:

ACTION

Step 8:

ACTION

Step 9:

ACTION

Step 10:

ACTION

Step 11:

ACTION

Step 12:

ACTION

Step 13:

ACTION

Step 14:

ACTION

Step 15:

ACTION

Step 16:

ACTION

Step 17:

ACTION

Step 18:

ACTION

Step 19:

ACTION

Step 20:

ACTION

Step 21:

ACTION

Document Type: Instruction
Content Type: Howto | Troubleshooting | Mustgather | Workaround | FAQ | Alert
Hardware: all Power | Power5 | Power6 | Power7 | Power8
Operating System: all AIX Versions | AIX 6 | AIX 7
IBM Java: all Java Versions | Java 5.0 | Java 6.0 | Java 6.1 | Java 7.0 | Java 7.1 | Java 8.0
Author(s): First Last
Reviewer(s): First Last
Click here to submit feedback for this document.