Search code examples
javaunixsolarisjava-threads

Solaris unix NLWP limit


I have a question regarding increasing the limit of NLWP under one process on unix solaris.

Suppose one java process is running and if I type command like this

prstat

It gives output with following content:

java/2000

Here 2000 are NLWP. So how can I increase or decide this limit of NLWP?

Thanak


Solution

  • By default, there is no hardcoded limit but there might be settings that cap the number of threads par task, project or zone. See:

    task.max-lwps, project.max-lwps and zone.max-lwps
    

    Otherwise, you might reach limits depending on the stack size and the kind of jvm used.

    If you get out of memory errors, switch to a 64 bit JVM if not already and, if compatible with your code, try reducing the size of the java stack size with the -Xss option, e.g.

    -Xss128k
    

    but beware too small a stack my lead to java.lang.StackOverflowError errors.

    Finally, if your java process is limiting itself to some number of thread, there is nothing you can do with JVM or system tuning. Have a look to the code or the program documentation.