kjkoster
25-07-2008, 12:30
Dear all,
Most if not all servers today have multiple processors and/or multiple processor cores. With the relatively easy support for multithreaded programming, Java comes well-equipped to make use of all that computing power.
However, the default Java virtual machine runs in the so-called client mode. In client mode, the JVM maps all of the Java threads onto a single native thread. This has the effect of making the JVM run on only one processor core at any given tiem.
In order to make the JVM use more than one native thread, you have to supply the -server (http://blogs.sun.com/watt/resource/jvm-options-list.html) command line option.
Running an application on more than one processor core only helps if your application is compute-bound (http://en.wikipedia.org/wiki/CPU_bound). If our application is IO-bound (http://en.wikipedia.org/wiki/IO_bound), you are not likely to see any improvement. I think that most distributed applications are IO-bound, especially SOA (http://en.wikipedia.org/wiki/Service-oriented_architecture) based applications. Does anyone have an figures on that?
Switching to the server JVM is quite a big deal, actually. On top of a completely different way of mapping Java threads onto native threads, you get a different HotSpot compiler, different garbage collectors and different memory pools. From what I heard, the server and the client VM are actually developed and maintained by different teams within Sun.
So ... own up. Who knew this and is running all his applications in server mode and who had to go in and check? :-)
Kees Jan
Most if not all servers today have multiple processors and/or multiple processor cores. With the relatively easy support for multithreaded programming, Java comes well-equipped to make use of all that computing power.
However, the default Java virtual machine runs in the so-called client mode. In client mode, the JVM maps all of the Java threads onto a single native thread. This has the effect of making the JVM run on only one processor core at any given tiem.
In order to make the JVM use more than one native thread, you have to supply the -server (http://blogs.sun.com/watt/resource/jvm-options-list.html) command line option.
Running an application on more than one processor core only helps if your application is compute-bound (http://en.wikipedia.org/wiki/CPU_bound). If our application is IO-bound (http://en.wikipedia.org/wiki/IO_bound), you are not likely to see any improvement. I think that most distributed applications are IO-bound, especially SOA (http://en.wikipedia.org/wiki/Service-oriented_architecture) based applications. Does anyone have an figures on that?
Switching to the server JVM is quite a big deal, actually. On top of a completely different way of mapping Java threads onto native threads, you get a different HotSpot compiler, different garbage collectors and different memory pools. From what I heard, the server and the client VM are actually developed and maintained by different teams within Sun.
So ... own up. Who knew this and is running all his applications in server mode and who had to go in and check? :-)
Kees Jan