Print

Print


Hi 

We have been seeing intermittent problems with tomcat at a number of
different sites.  While some of these have been configuration problems
others have been problems with Java.  The errors are Java/NIO/hotspot
errors in native code outside of the hotspot compiler

The only sure way we have found that cures the problem so far is to
switch java to use interpreted mode(replace -server with -Xint in the
JAVA_OPTS or CATALINA_OPTS environment variables). This has been running
successfully on the prototype for over a month now. 

We have tracked down a fix which we are about to try on the prototype
that we hope will allow the use of hotspot compiler and the improved
performance it gives.

Background
=========== 

Differences between NPTL(Native Posix Thread Library) and LinuxThreads

Linux is undergoing a shift within a few of the libraries that compose
the core of the Linux run time code. The library of significant concern
is libpthread. This library provides normal implementation of threading
(POSIX threads) that programs on the machine can use.

RHEL and hence SL kernel versions >= 2.4.20 assume by default NPTL
kernel versions <= 2.4.19 assumes the earlier Linux Threads

The problem occurs with the NPTL. This can be overridden by the use of
an environment variable LD_ASSUME_KERNEL 

LD_ASSUME_KERNEL=2.4.20
        This override requests the GLIBC/pthreads implementation that
        conforms to kernel ABI version 2.4.20 or later. This
        implementation is the minimum ABI required for NPTL. This is the
        default mode for RHEL 3.
        
LD_ASSUME_KERNEL=2.4.19
        This override requests the GLIBC/pthreads implementation that
        conforms to kernel ABI version 2.4.1. This implementation is
        commonly referred to as standard LinuxThreads with floating
        stacks. 
        
        This implementation has been the standard implementation of
        threading on Linux for several years.
        
Anyone who is finding the hotspot errors have 2 options:

1. Switch java to use interpreted mode, 
        For tomcat4 set the JAVA_OPTS in /etc/tomcat4/tomcat4.conf
to   include
-Xint and remove -server or -client options
        For tomcat5 set the CATALINA_OPTS in /etc/tomcat5/tomcat5.conf
to include -Xint and remove -server or -client options

2. Set the LD_ASSUME_KERNEL=2.4.19 and use the -server option in
        JAVA_OPTS or CATALINA_OPTS as above.

Option one works well, we are about to test option 2 but you are welcome
to try it.