Server mode?

I was looking through java

jME can be run in server mode and typically gives you a bit of a performance boost.  It does increase startup time and depending on what your game is doing could cause problems that might make it run less efficient overall.  I would recommend looking into server and hotspot modes before making a blanket decision about what mode you should run your game in.


I am sorry if I was not clear. I am trying to ask if the JME should recommend server mode and if the demos should use server mode. If server mode is faster then it may make JME look more completive compared to C++ engines.

Havent looked into it - but at an educated guess, server mode would suggest no graphics and lots of processing

If you refer to “java -server” you’re all wrong imo: -server switches off hotspot (just in time compilation) and some other speed optimizations to make java execution/interpretation more reliable (rtf sun m :)). This obviously makes it slower, thus it is definately not suited for games or demos.

Well, last time i looked they stated that -server is optimized for … well servers :slight_smile: and

The most significant difference is the "Server" VM has a lower threshold for the required method invocation count before compiling a method.

However, in jME most of the methods called, are called so many times that they are flagged for compilation by the VM within the first second (everything for rendering a frame), or are only called once (most startup methods) so they're compiled on neither type.

There are some other more subtle differences (eg. class loading and unloading) but none of these will effect jME in a significant way I think (eg. there hardly any classes in jME that will be unloaded anyway). The client VM will behave almost exactly like the server VM.

Compare this an application like Eclipse, try running it in server mode and it will start sucking up memory like there's no tommorow, and the first time you try any new action in the IDE it's time for your lunchbreak.

ok, i ran TestSwarm in default configuration and approx 1 min warmup out of NetBeans IDE and approx 5 programs in the background on xp:

without -server :

Oh, you're right  :-o there's a significant fps gain! And yes, it seems I should have looked at a more up to date sun doc myself

It seems that -server option in deed may be beneficial to some apps…

Ok, lets conclude then: usage of -server probably sould be leaved to the user (developer) - if You need some quick fps then try, otherwise don't mind as it might make user experience worse actually.

points to his first reply to this message  :-p

I actually did tests with server mode a few months ago in jME.  It depends a lot on your game model whether it is worthwhile to run in server mode.