aspose file tools
The moose likes Threads and Synchronization and the fly likes how many threads to create within a jvm? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "how many threads to create within a jvm?" Watch "how many threads to create within a jvm?" New topic
Author

how many threads to create within a jvm?

Nick Faiz
Greenhorn

Joined: Oct 12, 2002
Posts: 11
How does one measure how many threads to create within a given jvm, to provide optimal performance?
I ask because Im writing an application that must make a threaded request of SAP for every order number it finds in an database. It seems unreasonable that I allow this to be an open-ended number of threads, even though my employers will never have an infinite amount of orders in their database.
I'm thinking of writing some kind of optimization algorithm using Runtime.freeMemory(), totalMemory() and maxMemory().
Is there a better alternative?
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

You will have to test to see the optimum number. But this number will change depending on your environment so your software should be configurable in that sense.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how many threads to create within a jvm?
 
Similar Threads
how many threads start
how many threads are created by JME VM?
When you run a program how many threads will create ?.
java.lang.OutOfMemoryError on server
muti threading!