Skip navigation.
Home

Maximizing Java performance on AIX

This article provides several tips and techniques that are commonly used for tuning Java applications for optimum performance on AIX. A discussion of the applicability of each tip is also provided. Using these tips, you should be able to quickly optimize the Java environment to suit your application's needs.

Quick Tips

Update: AIXTHREAD_SCOPE, AIXTHREAD_MUTEX_DEBUG, AIXTHERAD_COND_DEBUG, AIXTHREAD_RWLOCK_DEBUG are set to the following settings by default in IBM JDKs (above 1.3 I think).

  • AIXTHREAD_SCOPE=S The default value for this variable is P, which 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 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 must wait while the search is completed. For optimal performance, you should set the value of this thread-debug option to OFF. Their default is ON.
  • SPINLOOPTIME=500 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 command 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

IBM article about Java tuning in AIX


Part 1- This article talks about prerequisites for a successful tuning effort, and provides an overview of the tools that are available to aid in such an exercise.
Part 2 - This article looks at ways to maximize the execution speed and throughput of a system. For programs that involve a user interface, we also look at how to ensure that responsiveness of the system is kept within acceptable levels.
Part 3 - This article concentrates on tuning that involves various types of memory structures (Java heap, native heap, stacks), and looks at ways to optimize the system for sizing.
Part 4 - The purpose of this article is to deal with situations where I/O or networking may become bottlenecks.
Part 5 - This section talks about translating Sun Java configuration to IBM Java configuration, and System-wide tuning for AIX applications. The scope of both of these topics is quite vast, so we only touch them briefly.