"Limited number of threads. OutOfMemoryException"

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
Post Reply
Saadi
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

"Limited number of threads. OutOfMemoryException"

Post by Saadi »

i am wondering if anyone has expierienced any issues with threads limitation on redhat 7.2. Is there a maximum number of threads a JVM can create per instance? I expect my server to at least be able to handle 1000-2000 clients concurrently. However while
running some tests, i have found that I run out of memory after
creating only 1024 Threads. this has been consistent on my Linux
box.

my test machine is a dual processor 2.4ghz with 2gb ram and lots of storage. I tried to increase the maximum size of the JVM stack with no
luck. Is there something I can do to increase the maximum nuber
of threads for my server?

also, i have read that compiling glibc with linuxthreads can also remedy the problem. i tried it bot to no avail because the compilation couldn't find Makecofig directory under the source tree.

if anyone out there who has had resolved such a problem, your help will be highly appreciated.

thanks.
Aziz Khawaja
Chicago, Il.
fawad
Site Admin
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
Location: Addison, IL
Contact:

Post by fawad »

Disclaimer: I've never done this myself.

http://www.jguru.com/faq/view.jsp?EID=237189 seems to say that you're correct. You do need to patch glibc. I'd recommend you try rebuilding from the srpms instead of doing it from scratch as the srpms tend to be compatible with the rest of your system.
Saadi
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

"Limited number of threads. OutOfMemoryException"

Post by Saadi »

fawad, thanks for posting the url link regarding my linux threads question. i'll try to rebuild the kernel (the way that have explained it) tomorrow when i go back to work. i hope my test goes successful after the change.
thanks again.
Aziz Khawaja
Chicago, Il.
Post Reply