Java
Registry Settings
JVM Performance Tuning
In order
to run applications written with the Droplets Platform's Java SDK, the
machine on which your Droplets Server is running must also have Java support
as outlined in this section.
Specifically,
you
must also have installed a version of either the JDK or JRE that conforms
to the JNI 1.2 specifications. This includes JDK
1.2, 1.3 or 1.4 (either Classic or HotSpot Client),
but not JDK or JRE 1.1.x.
Information on the JVM (as well as
all Java-based Droplet applications) must also be entered into the registry:
The
following JVM configuration parameters may be specified in the registry
as well only the
JVM parameter
is required. All
of them are string values underneath the SOFTWARE\Droplet\DropletServer\Java
key:
JVM
(required) |
The
full path to the JVM DLL that you wish the Droplets Server
to use to run Java applications. The specified JVM must fully
support the JNI 1.2 specification.
The
registry key HKEY_LOCAL_MACHINE\SOFTWARE\Droplet\Droplet
Server\Java contains an absolute path to the JVM DLL.
For the Sun JDK 1.3, the Classic JVM is in JDK_HOME\jre\bin\classic\jvm.dll
and the Hotspot Client JVM is in JDK_HOME\jre\bin\hotspot\jvm.dll.
In JDK 1.4, there is no Classic; use JDK_HOME\jre\bin\client\jvm.dll
for Hotspot Client, or JDK_HOME\jre\bin\server\jvm.dll
for Hotspot Server.
The default value for JVM is determined by the installer.
|
log-jvm-messages |
This indicates
whether messages that the JVM generates should be written
to the Droplets Server's
log.
You should
specify either "true" (it should be written to the
Droplets Server log) or "false" (it should not).
|
jvm-options |
A list
of options that will be passed directly through to the JVM.
Separate the options by spaces, as you would on a command
line. The possible options and their meaning is up to the
particular JVM, but there are some standard options that all
JVMs are required to support. See the JNI 1.2 specs for details.
See
JVM Performance Tuning below to learn how
to use this registry key to improve the performance of your
JVM with the Droplets Server.
Default:
empty
|
ignore-unrecognized-options |
This specifies
whether the presence of an option that is unrecognized by
the JVM should be considered a fatal error. A fatal error
will cause the loading of all Java applications into the Droplets
Server to fail.
You should
specify either "true" or "false" for this
key name. By default, its value is "true".
Note also
that there is a bug in the Sun classic version of JVM (as
of 1.3.0) that causes the ignore-unrecognized-options
parameter to be interpreted as false even if you set it to
true. Thus, with that Virtual Machine, you must always make
sure not to provide any JVM options that the JVM does not
recognize, regardless of what you set this parameter to.
|
stdout-file |
Specifies
the file to which the JVM's standard output stream will be redirected
in other words, where System.out.println()
will end up. |
stderr-file |
Specifies
the file to which the JVM's standard error stream will be redirected
in other words, where System.err.println()
will end up. |
To
register Java applications and classpaths, enter registry keys under:
HKEY_LOCAL_MACHINE\SOFTWARE\Droplet\DropletServer\Java
By the name of:
ClassPathX
ClassPathY
etc.
and
ServerX
ServerY
etc.
If you choose
to use numbers to identify your classpaths and servers (i.e. ClassPath0,
ClassPath1, etc.), then
the numbers must start with 0 and and move up in order (0,1,2,3).
You are not, however, restricted to using numbers to identify your classpaths
and servers; for example, you could use your application names if desired
(ClassPathHelloWorld, ClassPathDirectMessenger,
etc.).
All
ClassPathN
entries will be appended to the system CLASSPATH
before
any Java classes are loaded. Each ServerN
entry represents an application that you would like to run in the Droplets
Server.
Important
Note:
There are two major requirements that you must adhere to when assigning
values to ServerN registry keys:
-
It must be the fully qualified name of a Java
class that can be found in the CLASSPATH.
Use slashes as package name delimiters (e.g. “com/droplets/hello/HelloAppFactory”,
not “com.droplets.hello.HelloAppFactory”
-
The
specified class must implement the com.droplets.api
ApplicationFactory
interface and have a default (no-argument) constructor.
If
your Droplet is not loading, check the Platform
log for details.
JVM Performance Tuning
The
Droplets UI Server currently supports the Sun JDK 1.2, 1.3 and 1.4
JVMs in either Classic or HotSpot Client variety. Sun's HotSpot Server
JVM is supported only in JDK version 1.4, and JRockit is currently
not supported. It
is highly recommended that in all Droplets deployments you use the
HotSpot version of the JVM, as it results in much higher, more efficient
JVM performance.
Performance
tuning of the JVM which works in conjunction with the Droplets Server
is highly recommended for enterprise deployments as the JVM is otherwise
forced to reallocate memory for each user. JVM performance can be
tuned with regard to the initial and maximum memory heaps which are
allotted by the JVM. By default, the initial heap size for a Sun JVM
is 1 megabyte in JDK 1.2 and 2 megabytes in JDK 1.3 and above, and
the maximum heap size is 64 megabytes. You can improve JVM performance
with Droplets by overriding these defaults using the "jvm-options"
string within the HKEY_LOCAL_MACHINE\SOFTWARE\Droplet\Droplet
Server\Java registry key as shown below:
Initial
heap size |
-XmsNUMBER |
Maximum
heap size |
-XmxNUMBER |
NUMBER
will be a number followed by an optional multiplier. The multiplier
can be:
g
(for gigabytes)
m (for megabytes)
k (for kilobytes)
For
example, -Xms250m -Xmx500m
would set the initial heap size for the JVM to 250 megabytes and a
maximum heap size to 500 megabytes. If
no multiplier is specified , it is assumed that the number represents
bytes.
Recommendations
Initial
heap: You should set a higher initial heap size than is created
by default if you expect your Droplets Server to handle 200 or more
simultaneous connections.
Maximum
heap: You should always specify a maximum heap so that the Droplets
Server is aware of how much memory has been allotted to the JVM. The
ideal heap size varies depending on the applications which your server
is hosting; if, for example, you
have a Droplets Server supporting 500 or more simultaneous users,
you will probably need at least 200m of memory allotted to the JVM.
|