This Solution explains how to configure two HP-UX kernel parameters for JavaTMSupport so that the maximum number of threads per process is not encountered. Reaching the maximum number of threads per process is usually seen as a Java Out of Memory error.
To determine if this is the error causing the problem check the admserv.log for errors relating to the Java Out of Memory error. There should be a note in this log as to which log file will contain details about the resource error. (ie. ads0.exp )
Java programs can use threads and sockets heavily. Server applications commonly spawn one to two threads for each client connected to the server (one socket connection to read and another to write).
According to Hewlett Packard, the default values for HP-UX 11.0 are set too low for most Java applications. Two kernel parameters need to be set so that the limit of the maximum number of threads per process is not encountered.
They are max_thread_proc and nkthread.
To work around the Out of Memory error, the value of the max_thread_proc must be set higher than the expected maximum number of simultaneously active threads for the application.
The number of threads needed by the process can be checked by using the -eprof option available with JDK 1.1.8. Analyze the Java.eprof file using HPjmeter by selecting the threads metric.
For information about HPjmeter, refer to:http://www.hp.com/products1/unix/java/hpjmeter/
max_thread_proc is the maximum number of threads allowed in each process. The minimum value (and default) is 64, and is often too low for most Java applications. The maximum value is the value of nkthread.
They appear in the kernel as:
Java Generic Server
nkthread is the total number of kernel threads available in the system. This parameter is similar to the nproc tunable except that it defines the limit for the total number of kernel threads able to run simultaneously in the system.
The value of nkthread must be greater than nproc. The default is approximately twice that of nproc. The maximum is 30000. The suggested value of nkthread is 2*max_thread_proc.
If there are a lot of Java processes running and each running process uses many threads, the value of nkthread must be increased to support the number of processes running.
(Remember, nkthread limit should be based on what the max_thread_proc is set to.)