LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 12-04-2002, 10:28 AM   #1
amar
LQ Newbie
 
Registered: Dec 2002
Posts: 2

Rep: Reputation: 0
maximum # of threads question


Hi,

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.

Any help is appreciated.

Thanks.

Amar
 
Old 12-04-2002, 12:00 PM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
oo. Sounds like a HotSpot issue to me.. have you tried posting in any of the JVM forums?
 
Old 05-30-2003, 02:01 PM   #3
sranga
LQ Newbie
 
Registered: May 2003
Posts: 2

Rep: Reputation: 0
Hi Amar,

Were you able to solve this problem? We are facing a similar issue. Appreciate any suggestions you may have.

- Ranga
 
Old 05-30-2003, 02:56 PM   #4
0x4B
Member
 
Registered: May 2003
Location: Nashville TN, USA
Distribution: Debian (I'm unstable)
Posts: 117

Rep: Reputation: 15
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.
 
Old 05-30-2003, 04:40 PM   #5
sranga
LQ Newbie
 
Registered: May 2003
Posts: 2

Rep: Reputation: 0
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?

- Ranga
 
Old 06-04-2003, 06:30 PM   #6
amar
LQ Newbie
 
Registered: Dec 2002
Posts: 2

Original Poster
Rep: Reputation: 0
Ranga,

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.

Amar
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java threads listed using kill -3 does not contain all threads found using ps -auxww coneheed Programming 2 11-14-2005 08:57 AM
Java Threads vs Native Threads rjmendez Programming 0 08-16-2004 05:58 AM
question about subscribtion to threads lyceum LQ Suggestions & Feedback 8 07-09-2004 01:15 PM
question about threads Jo_Nak Programming 1 08-23-2003 11:43 AM
Maximum Linux Colonel Panic General 7 07-24-2001 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration