By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Maximum number of Threads

P: n/a
I'm developing a simple Java client that runs over a CORBA server.
The main client thread is waiting for notification from this server.
On each notification,
The client creates a new thread executing some logic with the server and close.
Each session spend most of the time waiting for the server.
At most there can be ~1000 open session.
My questions are:
1. How many threads can be open at the same time
(with response time of up to ~1 second)?
2. Does the JVM open a native thread for each java thread?

I know both question is OS and JVM dependent,
so I'm not expecting exact numbers here. The client will probably run on Solaris or NT.

Thanks.
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Tzach" <tz***@phonedo.com> wrote in message
news:m1************@netra01.phonedo.co.il...
I'm developing a simple Java client that runs over a CORBA server.
The main client thread is waiting for notification from this server.
On each notification,
The client creates a new thread executing some logic with the server and close. Each session spend most of the time waiting for the server.
At most there can be ~1000 open session.
My questions are:
1. How many threads can be open at the same time
(with response time of up to ~1 second)?
2. Does the JVM open a native thread for each java thread?

I know both question is OS and JVM dependent,
so I'm not expecting exact numbers here. The client will probably run on Solaris or NT.
Thanks.


On the first question, I've had upwards of 7000 threads running
simultaneously on Win XP Home before I got an OutOfMemoryException. I never
tried changing the memory usage from the command line, though.
Jul 17 '05 #2

P: n/a
"Tzach" <tz***@phonedo.com> wrote in message
news:m1************@netra01.phonedo.co.il...
I'm developing a simple Java client that runs over a CORBA server.
The main client thread is waiting for notification from this server.
On each notification,
The client creates a new thread executing some logic with the server and close. Each session spend most of the time waiting for the server.
At most there can be ~1000 open session.
My questions are:
1. How many threads can be open at the same time
(with response time of up to ~1 second)?
2. Does the JVM open a native thread for each java thread?

I know both question is OS and JVM dependent,
so I'm not expecting exact numbers here. The client will probably run on Solaris or NT.
Thanks.


On the first question, I've had upwards of 7000 threads running
simultaneously on Win XP Home before I got an OutOfMemoryException. I never
tried changing the memory usage from the command line, though.
Jul 17 '05 #3

P: n/a
Tzach <tz***@phonedo.com> wrote in message news:<m1************@netra01.phonedo.co.il>...
I'm developing a simple Java client that runs over a CORBA server.
The main client thread is waiting for notification from this server.
On each notification,
The client creates a new thread executing some logic with the server and close.
Each session spend most of the time waiting for the server.
At most there can be ~1000 open session.
My questions are:
1. How many threads can be open at the same time
(with response time of up to ~1 second)?
AFAIK this is OS dependent. I'm not aware that Java has a limit, but
your OS probably does.
2. Does the JVM open a native thread for each java thread?


Depends upon the implementation you are running, but many JVM's are
very close to the OS when it comes to threading, so the number of
threads used by your application will probably match the number of OS
threads running (don't forget to include Java's own threads like the
garbage collector!)
-FISH- ><>
Jul 17 '05 #4

P: n/a
Tzach <tz***@phonedo.com> wrote in message news:<m1************@netra01.phonedo.co.il>...
I'm developing a simple Java client that runs over a CORBA server.
The main client thread is waiting for notification from this server.
On each notification,
The client creates a new thread executing some logic with the server and close.
Each session spend most of the time waiting for the server.
At most there can be ~1000 open session.
My questions are:
1. How many threads can be open at the same time
(with response time of up to ~1 second)?
AFAIK this is OS dependent. I'm not aware that Java has a limit, but
your OS probably does.
2. Does the JVM open a native thread for each java thread?


Depends upon the implementation you are running, but many JVM's are
very close to the OS when it comes to threading, so the number of
threads used by your application will probably match the number of OS
threads running (don't forget to include Java's own threads like the
garbage collector!)
-FISH- ><>
Jul 17 '05 #5

P: n/a
You are right in saying this is both JVM and OS dependent. Its been some
time since I worked with threads, so here is what my memory serves me

I think in your situation what you might need is a Thread que and submit
jobs to this que as they come in. It would definately be a more controlled
approach in your client app. Usually there is a limit (based on OS, JVM
hardware etc) after wich the JVM performance drops dramatically. I have seen
this happen on one of my past projects. The server came to a screching halt
after around 300+ threads, but this was back in 98. Both hardware, OS and
JVMs have evolved since then.

Now about Threads JVM and OS
JVM, There are green_thread and native_thread JVMs
There is also np-threads implementation (I think from IBM) where in n native
threads map to p number of JVM threads (I think the JDK1.4 mixed-mode JVM is
of this type).
Then comes the OS, I belive linux has a per process restriction (built into
the kernel) of around 128 native threads (I don't recall the exact number).

If a JVM is spawning native thread for every thread in the JVM then the
performace is based on the OS, behaviour, number and everything else is
dependent on the OS. Native threads are better in performance than
green_threads implementation where the JVM manages its own threads. On the
other hand greenthreads behave exactly the same on multiple platforms, since
the JVM is managing them.

cheers
Haider
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message
news:8p********************@texas.net...
"Tzach" <tz***@phonedo.com> wrote in message
news:m1************@netra01.phonedo.co.il...
I'm developing a simple Java client that runs over a CORBA server.
The main client thread is waiting for notification from this server.
On each notification,
The client creates a new thread executing some logic with the server and close.
Each session spend most of the time waiting for the server.
At most there can be ~1000 open session.
My questions are:
1. How many threads can be open at the same time
(with response time of up to ~1 second)?
2. Does the JVM open a native thread for each java thread?

I know both question is OS and JVM dependent,
so I'm not expecting exact numbers here. The client will probably run on

Solaris or NT.

Thanks.


On the first question, I've had upwards of 7000 threads running
simultaneously on Win XP Home before I got an OutOfMemoryException. I

never tried changing the memory usage from the command line, though.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.