HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 96 (of 101)
Chapter 11 Software Development
October 29, 2013
reduced stacksize of 508k, both stack and guard page will fit into 2x 256k, and the mapping will
occupy exactly 512k, with nothing wasted.
The java heap size (-Xmx option) might need to be adjusted to reflect the real requirements of the
java application. A too large java heap wastes address space at the expense of the JVM. The
required heap sizes can be found by analyzing GC logs with HPjmeter.
In some cases it might help to increase the java heap. E.g. if the JVM ran out of memory with a
java heap of 1400MB (which left nearly 600MB for the JVM), increasing the heap size to
1600MB will cause java_q3p being used instead of java, and with its 3GB private address
space, now nearly 1400MB can be used by the JVM.
If all else fails, the 64-bit JVM can be used with the d64 option, which is available since java
1.4. But sometimes this is not applicable, especially if JNI is used, because the 3
rd
party native
libraries might not be available as 64-bit versions.
The JVM will also report a java.lang.OutOfMemoryError when it was not able to create a new
thread. There are two possible reasons for that. Either there was not enough space to allocate
(map) a new thread stack. The solution in this case is the same as above, when the JVM runs out
of process heap. Or the maximum number of threads per process (max_thread_proc) or system
wide (nkthread) has been reached.
The number of threads can be found out with gdb to compare it with the kernel parameters:
$ echo info thr | gdb /opt/java1.4/bin/PA_RISC2.0/java core | \
grep -c "system thread"
224
$
To solve this problem, either increase the kernel parameters, or check if the application should
really create as many threads as it had. It might be a problem in the application, if it creates an
unexpectedly high number of threads.
Environment Variables
This chapter gives an overview to some helpful environment variables that are used by the
products described in this document.