Operating System - Linux
1830929 Members
2257 Online
110017 Solutions
New Discussion

Re: unable to create new native thread - linux

 
SOLVED
Go to solution
Vijaya Kumar_3
Respected Contributor

unable to create new native thread - linux

I am getting this error when i start weblogic.

Throwable: java.lang.OutOfMemoryError: unable to create new native thread

I know it has to do something with number of threads per process.

can anyone tell me what are these these parameters like nproc etc. Is there any parameter that sets no. of threads per process? per user?
pls let me know
thanks
vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: unable to create new native thread - linux

Your Linux distribution would help.

If you are running REd Hat 9, there is a graphical display for making some kernel changes on the fly in X-Windows.

On older distributions, you have to compile a new kernel.

Instructions:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=234110

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vijaya Kumar_3
Respected Contributor

Re: unable to create new native thread - linux

It is rhl 7.2

i would like to know the parameters, i tried searching for nthreads and nproc... but no luck.

i know we can do on the fly kernel parameter changes in RHL7.2 too. i need to know threads parameters.

thanks
vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Huc_1
Honored Contributor

Re: unable to create new native thread - linux

I dont remember in 7.2 but in 9.0 you can find this with the following command, try your luck !

cat /proc/sys/kernel/threads-max

# /sbin/sysctl -a

will also show all the present kernel parameters.

have a read of man sysctl to find out more about changing theses values.

Hope this help by-pass this lack of ressources !

J-P
Smile I will feel the difference
Huc_1
Honored Contributor

Re: unable to create new native thread - linux

I miss that part of your question on first read and reply.

To set the number of process per user (nproc)

cat /etc/security/limits.conf

tell you the present values
you may change these to meet your needs.

J-P
Smile I will feel the difference
Schelstraete Bart_1
Frequent Advisor

Re: unable to create new native thread - linux

Check out this link, and check the 'increase threads' section:

http://linuxperf.nl.linux.org/general/kerneltuning.html


rgrds,
Bart
Huc_1
Honored Contributor

Re: unable to create new native thread - linux

Thanks, Bart

I found your link to be very good !

The following entry from a few days back is nearly the same so I have posted A link there to to here

link to other question here below
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=237598

Hope theses cross references help reply to both questions.

J-P
Smile I will feel the difference
chengsongbo
New Member
Solution

Re: unable to create new native thread - linux

I got the same problem.

For jvm-options:
-Xssn -Xossn -XX:threadstacksize=n
can set thread stack size to n Kilobytes.

These option works under Solaris, AIX,
but under linux, these options seems lose function. So the only way to decrease thread stack size from default 8M to a resonable size is to use system command:

ulimit -s n

This command can be added into the start up script so that only affect the java server.

For my instance, with default setting, my Weblogic server can only use about 800M Heap. When I set thread stack size to 1024k by:

ulimit -s 1024

I can have a heap size at about 1.5G.

For any process under linux, the total memory size cannot exceed 2G. For a JVM process,
MaxHeap + MaxPermsize + threadstacksizee * numberofThreads < 2G.

So you can adjust your setting by you need.
Vijaya Kumar_3
Respected Contributor

Re: unable to create new native thread - linux

Thanks a lot
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com