Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Performance Tuning Guide

- Previous: File Descriptor Setting
- Next: Linux Configuration

## Using Alternate Threads

The Solaris operating environment by default supports a two-level thread model (up to Solaris 8). Application-level Java threads are mapped to user-level Solaris threads, which are multiplexed on a limited pool of light weight processes (LWPs). To conserve kernel resources and maximize system efficiency, you need only as many LWPs as there are processors on the system. This helps when there are hundreds of user-level threads. You can choose from multiple threading models and different methods of synchronization within the model, depending on the JVM.

Try to load the alternate `libthread.so` in `/usr/lib/lwp/` on Solaris 8 by changing the `LD_LIBRARY_PATH` to include `/usr/lib/lwp` before `/usr/lib`. Both give better throughput and system utilization for certain applications; especially those using fewer threads.

By default, the Application Server uses `/usr/lib/lwp`. Change the default settings to not use the LWP by removing `/usr/lib/lwp` from the `LD_LIBRARY_PATH` in the `startserv` script, but avoid doing this unless it is absolutely required.

For applications using many threads, `/usr/lib/libthread.so` is the best library to use. Of course, see using `-Xconcurrentio` for applications with many threads as this will not only turn on LWP based sync, the default in 1.4, but also turn off TLABS, or thread local allocation buffers, which can chew up the heap and cause premature garbage collection.

### Further Information

For more information on Solaris threading issues, see Solaris and Java Threading.

For additional information on tuning the HotSpot JVM, see Further Information .

- Previous: File Descriptor Setting
- Next: Linux Configuration

- © 2010, Oracle Corporation and/or its affiliates