How many native threads can be created by a JVM in Linux?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Seung_Lee
Posted On:   Tuesday, October 30, 2001 05:42 PM

I have tuned a machine (redhat 7.1, kernel 2.4.2-smp on an i686). see below. $ulimt -n core file size (blocks) 1000000 data seg size (kbytes) unlimited file size (blocks) unlimited max locked memory (kbytes) unlimited max memory size (kbytes) unlimited open files 8192 pipe size (512 bytes) 8 stack size (kbytes) 8192 cpu time (seconds) unlimited max user processes 16382 virtual memory (kbytes) unlimited $ cat /proc/sys/kernel/threads-max 32764 But, I could create just 1016 threads, using jdk.1.4.b VM. If I try to create more thread, VM    More>>


I have tuned a machine (redhat 7.1, kernel 2.4.2-smp on an i686). see below.

			
$ulimt -n
core file size (blocks) 1000000

data seg size (kbytes) unlimited
file size (blocks) unlimited
max locked memory (kbytes) unlimited
max memory size (kbytes) unlimited
open files 8192
pipe size (512 bytes) 8
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 16382
virtual memory (kbytes) unlimited

$ cat /proc/sys/kernel/threads-max
32764


But, I could create just 1016 threads, using jdk.1.4.b VM. If I try to create more thread, VM throws an outOfMemoryException.

If I lunch two VMs, each VM creates 1016 threads, totally 2032.


I want to create about 2000 native threads (not green) that have respective TCP connection.

What is to be done?

please, help me



If you show me another VM what can do that, I'll appreciate you, too.

   <<Less

Re: How many native threads can be created by a JVM in Linux?

Posted By:   Andrew_Cuthbertson  
Posted On:   Friday, November 23, 2001 08:04 AM

In Linux there is also the soft limit
/etc/security/limits.conf.


Maybe your soft limit is set to 1024. This would mean that any user on a linux machine can only create 1024 threads. This would seem to match the limit you are getting (i.e. 8 threads for other user land programs run by you - bash etc)

Re: How many native threads can be created by a JVM in Linux?

Posted By:   Dermot_Hennessy  
Posted On:   Wednesday, October 31, 2001 02:34 AM

This may be of no help to you, but since you are receiving an OutOfMemory error, have you considered increasing the memory available to the JVM, using the requisite -X tag?

Dermot

About | Sitemap | Contact