Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using Linux 2.4.18-3 and we are trying to solve a problem related to our java server application. When the application wants to create new threads I get following exception :
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start(Native Method)
at sirrus.authserver.TcpServer$ServerSocketThread.run(TcpServer.java:273)
# of processes running for this application at the time of error : 717.
I did some reseaarch and found outh that there is a 'threads-max' file in /proc/usr/kernel which controls # of threads. I bumped it up from 8170 to 12000. I also bumped up the 'files-max' file value to 75000. I still see the problem. I am using Sun's hotspot jvm version 1.3.1 . BTW, the problem goes away when I use the 'classic' jvm.
I had a java.lang.OutOfMemoryError once running an experiment. In my case the error was a result of the jvm reaching its max memory allocation. there is a parameter that limits the amount of memory that the jvm will attempt to use. passing the -Xmx### option sets the maximum size of the allocation pool (and it defaults to 64 megs). the numeric part can be #k or #m to indicate kilo- / mega- bytes (capital K and M work too). the value must be a multiple of 1024 and greater than 2M.
Thanks 0x4B.
I start my application with -Xmx1500m. The error is not because of insufficient memory. Its because of the # of threads being created.
Any ideas?
Unfortunately, we had to limit allowable # of thread for the application. We tried playing with a thread's stack size (-Xss<size> option) to limit memory used by it. The default stack size is 2MB. You can try reducing it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.