4.5 AIX-specific Java environment settings

The following tables list the set of recommended settings for the AIX Java environment.

Environment settings...

Environment variable Recommended value
AIXTHREAD_SCOPE S
AIXTHREAD_MUTEX_DEBUG OFF
AIXTHERAD_COND_DEBUG OFF
AIXTHREAD_RWLOCK_DEBUG OFF
SPINLOOPTIME 500

For Java 5, the java command automatically sets these settings (except SPINLOOPTIME). These settings are only necessary when using JNI to invoke Java (meaning when a non-Java application executes Java code or a Java program.

In AIX 5.2, Java runs with system-wide contention scope threads.

Each Java thread is mapped one-to-one to an AIX kernel thread

Calls to java.lang.Thread.setPriority() have no effect.

In AIX 5.3 and later, programs can set the priority of system contention scope threads Java 5.0 exploits this feature, but Java1.4.2 does not.

Calls to java.lang.Thread.setPriority() will change the priority.

SPINLOOPTIME controls the number of times the system will retry a busy lock before yielding to another process. The default value is 40. This should be increased to 500 or higher because a busy lock retry is inexpensive compared to the alternative. Use the tprof command to determine if the check_lock routine has high CPU usage. If it does, you can increase the value even more.

Table 4-2 Recommended process settings for Java

Process limits Setting
data area, in number of K bytes. ulimit -d unlimited
stack size, in number of K bytes ulimit -s unlimited
physical memory, in number of K bytes ulimit -m unlimited
file descriptors a process may have ulimit -n unlimited

Example 4-10 shows the contents of a startup file (rc.was) we used to set parameters.

#Check and set the required WebSphere process environment within file rc.was
#
for LIMITV in d \
              s \
              m \
              n
do
LIMIT=`ulimit -${LIMITV} `
if [ "${LIMIT}" != "unlimited" ]
then
	ulimit "-${LIMITV}" unlimited
fi
done
#
export AIXTHREAD_SCOPE=S
export AIXTHREAD_MUTEX_DEBUG=OFF
export AIXTHERAD_COND_DEBUG=OFF
export AIXTHREAD_RWLOCK_DEBUG=OFF
export SPINLOOPTIME=500

Next