Fog Creek Software
Discussion Board

Simultaneous virtual machines

Let's imagine that my colleagues/managers consider running 30 (thirty) JVMs simultaneously on a production machine (because they want to run 30 instances of the same Java program), and that I am thus thrown into perplexity.
Apart from my instinctive feelings, what sound arguments could be given in this context ?
(Bi-pro W2K box, if it is of any interest).

Monday, May 26, 2003

Well you have three major issues, probably.

First is memory. Memory is cheap, so that shouldn't really be a stopping point.

Second is communication. If this thing is running 30 times, do they all talk to each other? Or are they independent entities?

Third is CPU. How busy are these things? If they're constantly computing, then running 30 of them is more or less counter-productive. However, if they spend most of the time waiting for input, then there's no reason that a modern computer can't handle 30 things running at once (in fact, you probably have a couple dozen things running at once just after booting a Win2K box).

So it doesn't really sounds like that big a deal, if your problem space is appropriate.

Brad Wilson (
Monday, May 26, 2003

What OS are you running on?

Daniel Shchyokin
Monday, May 26, 2003

'thus thrown into perplexity'

Can I steal that? <g>

Monday, May 26, 2003

Why don't you run a multi-threaded application in a single JVM? There would be a lot less overhead.

Tuesday, May 27, 2003

Julian, you remind me of this about recycling VMs

Tuesday, May 27, 2003

Javalobby's Echnidna could be an alternative:

It provides process management for running multiple applications within a single JVM.

Ged Byrne
Tuesday, May 27, 2003

On a production machine? As in something a customer wants to see and use. Java processes are big, typically about 8MB and will grow big if they are doing a lot like GUI work. The biggest issue is resource sharing, things like filesystems, databases, sockets etc. Other than that, you might be OK for free memory, certainly with later VMs.

If this is a requirement for a customer site, then ultimately you need to consider making your application multithreaded. VM sharing is another issue, but I have no experience with it.

Your misgivings are as big as mine, running 30 VMs is somethign I wouldn't want to do. You get a lot of that stuff when you are makign CORBA servers and it can be unpleasant.

Tuesday, May 27, 2003

Thanks to all.

The application is not supposed to be CPU-bound (although the task manager rarely indicates less than 94 % ; it depends on the test computer though).
I suppose they chose the figure of 30 to fit in memory.
The processes do not talk to each other (apart from writing to a common database).
I forgot to mention that the server freezes from time to time, though not on every test computer, again.
(This is JRE 1.4.1_02 on Windows 2000.)

As suggested Julian, my idea was to run a multi-threaded application in a single JVM. But that would mean a few hours of development, which they seem afraid to do.

I didn't know Echidna, I suppose it could be the sort of tool to use in such a case.

P.S. :
B# : sorry for my funny-sounding expressions ; you can guess this is not my mother tongue ;-)

Tuesday, May 27, 2003


Quite the contrary!  That phrasing was perfect and I wish it had been mine...

Tuesday, May 27, 2003


There was an article in Java Developer's Journal written in the last year or so on how to run multiple applications on top of a single JVM as opposed to running each one in its own JVM.

I forget which  issue it was in, but it should be available from their website.

Avrom Finkelstein
Tuesday, May 27, 2003

Found the article, from the April 2002 issue.

"A Multiple Application Launcher"

Avrom Finkelstein
Tuesday, May 27, 2003

*  Recent Topics

*  Fog Creek Home