[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Performance Management Guide

Tuning Java

The following are recommended AIX settings for your JAVA environment.

AIXTHREAD_SCOPE=S
Starting with AIX 4.3.1, the default value for this variable is P. This signifies process-wide contention scope (M:N). For Java applications, you should set this value to S, which signifies system-wide contention scope (1:1).
AIXTHREAD_MUTEX_DEBUG=OFF
Maintains a list of active mutexes for use by the debugger.
AIXTHERAD_COND_DEBUG=OFF
Maintains a list of condition variables for use by the debugger.
AIXTHREAD_RWLOCK_DEBUG=OFF
The pthreads library maintains a list of active mutual exclusion locks, condition variables, and read-write locks for use by the debugger. When a lock is initialized, it is added to the list if it is not there already. This list is implemented as a linked list, so searching it to determine if a lock is present or not has a performance implication when the list gets large. The problem is compounded by the fact that the list is protected by a lock, which is held for the duration of the search operation. Other calls to the pthread_mutex_init() subroutine have to wait while the search is done. For optimal performance, you should set the value of this thread-debug options to OFF. Their default is ON
SPINLOOPTIME=500
The spinloop time is the number of times that a process can spin on a busy lock before blocking. This value is set to 40 by default. If the tprof output indicates high CPU usage for the check_lock routine, and if locks are usually available within a short amount of time, you should increase the spin time by setting the value to 500 or higher.

Also, the following settings are recommended for your Java environment:

ulimit -d unlimited

ulimit -m unlimited

ulimit -n unlimited

ulimit -s unlimited

Certain environment parameters and settings can be used to tune Java performance within the operating system. In addition, many of the techniques for tuning system components, such as CPU, memory, network, I/O, and so on, can serve to increase Java performance. To determine which may be beneficial to your situation, refer to the specific sections in this book.

To obtain the best possible Java performance and scalability, you should use the latest available versions for operating system and Java, as well as for your Just-In-Time (JIT) compiler .

Performance Implications for Garbage Collection

The most common performance problem associated with Java relates to the Garbage Collection mechanism. If the size of the Java heap is too large, the heap will have to reside outside of main memory. This would cause increased paging activity, which would affect Java performance. Also, a large heap can take several seconds to fill up. This means that, although Garbage Collection would occur less frequently, pause times associated to Garbage Collection will increase. To tune the Java Virtual Machine (JVM) heap, use the java command with option -ms or -mx. Use the Garbage Collection statistics to help determine optimal settings.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]