• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to run two JVM Processes in one machine  RSS feed

 
Venkateswara Rao
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to run two JVM Processes in one physical machine. I have one Machine. Depending on Client requests(If requests are exceed some number) i want to create another JVM process instead of running in separate thread. If any one knows please help me.
Thanks and Regards
Venkateswara Rao
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is how do you want to start the second JVM? Depending on your client architechture, You could do it with Runtime.exec("java client"). That is a somewhat risky approach since there would be nothing to stop the newly created client from spawning its own process later. Also, you would have to consume any output reslulting from stdout and stderr in the new process from within the client that created the new JVM. A better approach would be to have a simple RMI service which could create the new process for you. It could keep up with all the clients created and place constraints on the number created, etc.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!